Fork-ts-checker-webpack-plugin: 5.0.0-alpha.9: Build errors are not reported on initial build, only on incremental.

Created on 27 May 2020  路  7Comments  路  Source: TypeStrong/fork-ts-checker-webpack-plugin

Current behavior

Using webpack-dev-server. When I start a build webpack does not report any type errors. There is a message saying "Issues checking in progress..." but it's seemingly stuck:
Screen Shot 2020-05-27 at 1 32 41 PM

On any incremental build after that things work as expected and type errors are reported.

Expected behavior

Type errors should be reported on initial run, not just incremental builds.

Steps to reproduce the issue

This happens any time I start a build.

Issue reproduction repository

I will try to reduce my project down to a minimal reproduction repo if other information here is not enough.

Environment

  • fork-ts-checker-webpack-plugin: 5.0.0-alpha.9
  • typescript: 3.9.3
  • eslint: (eslint not tslint) 6.8.0
  • webpack: 4.43.0
  • os: macOS 10.14.6
bug released released on @alpha released on @beta

All 7 comments

I'm afraid we will need a reproduction repository because we have end-to-end tests that test this scenario in different environments and they pass :) So it's either something special with your configuration or environment that our tests don't coverage.

@piotr-oles OK I think I found the culprit. The problem seems to arise due to some interaction with workbox-webpack-plugin (https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin). I've attached a repro project. Here are the steps:

  1. npm install.
  2. npm start to build and run the project using webpack dev server.
  3. Note that no error is reported on start despite the type error in src/index.ts.
  4. Note that if you force an incremental update by saving a file the error will be correctly reported.
  5. Kill the dev server.
  6. In webpack.common.js comment out the workbox plugin i.e. the secion that starts with new WorkboxPlugin.InjectManifest({.
  7. Run npm start again.
  8. Note that the error now pops up on initial run.

Let me know if you need any other info.

webpack_repro.zip

Thank you for the reproduction repository :) The issue is that the workbox adds additional compilation which was not supported by the plugin. I added additional checks in the hooks to fix it :)

@piotr-oles AMAZING thank you for the quick turnaround! Will this be in alpha 12?

:tada: This issue has been resolved in version 5.0.0-alpha.13 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

:tada: This issue has been resolved in version 5.0.0-beta.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

:tada: This issue has been resolved in version 5.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Was this page helpful?
0 / 5 - 0 ratings