After updating to v6.0.0 of fork-ts-checker-webpack-plugin Webpack goes into an infinite loop where it rebuilds over and over.
This is while using webpack-dev-server to monitor for file changes.
Webpack should build once only.
Apologies I am unable to provide a minimal repository for this issue. I am happy to try to provide any log/output/debugging information that may help trace the issue.
6.0.0]4.0.5]7.13.0]5.4.0]Windows 10 (latest)]Attempting to use the following plugin to display a list of the modified files that were trigging the build was unfortunately unsuccessful. The plug simply reports an empty array (no modified files).
https://stackoverflow.com/a/64564708
Please use logger: { infrastructure: 'console' } option in the plugin to see why it rebuilds :)
Many thanks for your swift response :)
Using your advice I can see that the issue is related to the parsing/transpilation of Vue components. This has allowed me to create a minimal repository to reproduce the issue. Thanks for your assistance!
https://github.com/rmuchall/forktschecker-test
Not sure if this is helpful or distracting, but in my build (just ran into this problem about 20 minutes ago on Webpack 5.4, Yarn 2.3.3, Fork-TS 6.0.0) the recompilations are actually happening because of Yarn's virtual packages... Very strange, as I thought only my src directory was being watched - maybe this is the same problem for you?
Changed files: []
Deleted files: ["project-dir/.yarn/$$virtual",
"project-dir/.yarn/$$virtual/html-webpack-plugin-virtual-1f826e50b2",
"project-dir/.yarn/$$virtual/webpack-dev-server-virtual-97193fef9b",
"project-dir/.yarn/$$virtual/@hot-loader-react-dom-virtual-7925d62d0d",
"project-dir/.yarn/$$virtual/webpack-virtual-20f557443a",
"project-dir/.yarn/$$virtual/style-loader-virtual-fb24dccf6c",
"project-dir/.yarn/$$virtual/css-loader-virtual-dd5d84c951",
"project-dir/.yarn/$$virtual/postcss-loader-virtual-164291359e",
"project-dir/.yarn/$$virtual/react-hot-loader-virtual-3a6aef74de",
"project-dir/.yarn/$$virtual/react-table-virtual-6edbf85ecf",
"project-dir/.yarn/$$virtual/html-webpack-plugin-virtual-1f826e50b2/0",
"project-dir/.yarn/$$virtual/webpack-dev-server-virtual-97193fef9b/0",
"project-dir/.yarn/$$virtual/@hot-loader-react-dom-virtual-7925d62d0d/0",
"project-dir/.yarn/$$virtual/webpack-virtual-20f557443a/0",
"project-dir/.yarn/$$virtual/style-loader-virtual-fb24dccf6c/0",
"project-dir/.yarn/$$virtual/css-loader-virtual-dd5d84c951/0",
"project-dir/.yarn/$$virtual/postcss-loader-virtual-164291359e/0",
"project-dir/.yarn/$$virtual/react-hot-loader-virtual-3a6aef74de/0",
"project-dir/.yarn/$$virtual/react-table-virtual-6edbf85ecf/0"]
Edit: Should also mention, my tsconfig is pointed at src only, and I've tried ignoring this directory in eslint, webpack, tsconfig - with no luck. I'm not entirely sure how to get fork-ts watcher to ignore files.
I should also mention that when I disable the fork-ts plugin, webpack doesn't re-compile loop. There is some strange interop happening.
Thanks @rmuchall for the reproduction repository - I found the bug :)
@sureshjoshi Could you tell me which OS do you use? Is it Windows?
@piotr-oles
This is on MacOS 10.15.7
:tada: This issue has been resolved in version 6.0.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
FYI, I had the same issue, but I don't have any .vue files in my project. I tracked it down to using the clean-webpack-plugin (with some custom settings). These seemed to work ok with v5, but with v6 it caused this loop. Avoiding my custom clean settings (which I apparently no longer needed), it works fine with v6.
And with using the logger: { infrastructure: 'console' } option, it showed that the root dir of the project and its parent changed for some reason.
@sureshjoshi Could you provide a reproduction repository?
@piotr-oles I'll try to create one, my project I'm using is private at the moment.
@piotr-oles Okay, here it is... I tried to strip almost everything out that I could. I left in only what I thought is the minimal configuration to keep the repo as "real-world" as possible.
https://github.com/sureshjoshi/fork-ts-checker-reload-bug
Please note, I use yarn 2.3.3 - I just tried npm install and it didn't even work due to a resolution fight with webpack-dev-server and webpack 5... That might be related, but yarn seems to work.
:tada: This issue has been resolved in version 6.0.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Confirmed 6.0.2 fixes the recursive build problem on my example repo and in my private repo.
Thanks!
Most helpful comment
:tada: This issue has been resolved in version 6.0.2 :tada:
The release is available on:
Your semantic-release bot :package::rocket: