Fork-ts-checker-webpack-plugin: No TypeScript errors in webpack-dev-server

Created on 5 Jul 2017  路  4Comments  路  Source: TypeStrong/fork-ts-checker-webpack-plugin

Hello. Thanks for the great plugin - really helped us speed up the build.

We use it together with HappyPack as it's done here:
https://github.com/TypeStrong/ts-loader/tree/master/examples/happypack

Works great with webpack but TypeScript errors aren't showing in webpack-dev-server (we generally use it with overlay option which displays errors in a way they cannot be ignored).

Is there a way to fail dev-server build with fork-ts-checker?

Most helpful comment

It's because of the design - this plugin works asynchronously in watch mode and doesn't block emit. Because of that, webpack is not aware of errors - they are logged to the console directly by the plugin.

It's because it was created for our project which has an over 100k LOC and it didn't make sense to block emit when type checking is always longer.

I see that there is a lot small and middle-sized projects that use this plugin and there it make sense so I will add async flag in the next PR.

There is also hook API - you can check out @johnnyreilly notification plugin: https://github.com/johnnyreilly/fork-ts-checker-notifier-webpack-plugin - it doesn't block emit :)

All 4 comments

Sorry for the delay, I was very busy :/ I will take a look at this today, promise :)

It's because of the design - this plugin works asynchronously in watch mode and doesn't block emit. Because of that, webpack is not aware of errors - they are logged to the console directly by the plugin.

It's because it was created for our project which has an over 100k LOC and it didn't make sense to block emit when type checking is always longer.

I see that there is a lot small and middle-sized projects that use this plugin and there it make sense so I will add async flag in the next PR.

There is also hook API - you can check out @johnnyreilly notification plugin: https://github.com/johnnyreilly/fork-ts-checker-notifier-webpack-plugin - it doesn't block emit :)

(Hint: ... and in the IDE like Webstorm/IDEA there is an option in the Typescript tool window "Compile All" to see all errors in the project).

Released as v0.2.5 - please upgrade and add async: false in plugin options - it should solve your issue :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

farzadmf picture farzadmf  路  5Comments

phryneas picture phryneas  路  4Comments

ansf picture ansf  路  6Comments

Cristy94 picture Cristy94  路  4Comments

piotr-oles picture piotr-oles  路  3Comments