webpack / webpack-dev-server

Serves a webpack app. Updates the browser on changes. Documentation https://webpack.js.org/configuration/dev-server/.
MIT License
7.8k stars 1.44k forks source link

Issues with Yarn2 PNP / Webpack V5 / rebuild loop #2820

Closed Hecatron closed 3 years ago

Hecatron commented 4 years ago

Hi, I've noticed that when using Yarn V2 (PNP) and Webpack V5 in combination causes webpack-dev-server to go into a rebuild loop.

This might be related to https://github.com/webpack/webpack-dev-server/issues/2807 I'm not sure, should be interesting to see what happens when this is updated

Note I've been using the command "webpack serve --mode development --env development" instead of "webpack-dev-server" which fixes the issue with the latest webpack-cli

i 「wdm」: Compiling...
i 「wdm」: assets by status 5.79 MiB [cached] 1 asset
cached modules 3.78 MiB (javascript) 24.8 KiB (runtime) [cached] 416 modules
webpack 5.4.0 compiled successfully in 191 ms
i 「wdm」: Compiled successfully.
No issues found.
i 「wdm」: Compiling...
i 「wdm」: assets by status 5.79 MiB [cached] 1 asset
cached modules 3.78 MiB (javascript) 24.8 KiB (runtime) [cached] 416 modules
webpack 5.4.0 compiled successfully in 172 ms
i 「wdm」: Compiled successfully.
No issues found.
i 「wdm」: Compiling...
i 「wdm」: assets by status 5.79 MiB [cached] 1 asset
cached modules 3.78 MiB (javascript) 24.8 KiB (runtime) [cached] 416 modules
webpack 5.4.0 compiled successfully in 173 ms
i 「wdm」: Compiled successfully.
alexander-akait commented 4 years ago

Please provide reproducible test repo

Hecatron commented 4 years ago

Ok put one up here https://github.com/Hecatron/Example.WebpackDevserver1

alexander-akait commented 3 years ago

Sorry for delay, I will look at this tomorrow

alexander-akait commented 3 years ago

No problems with webpack or webpack-dev-server, just comment ForkTsCheckerWebpackPlugin and no problems, spent 1 hour on debug :disappointed: , please try latest version of https://github.com/TypeStrong/fork-ts-checker-webpack-plugin, locally fixed the problem, of you still ahve the problem , please open an issue in fork-ts-checker-webpack-plugin repo, thanks

Hecatron commented 3 years ago

Cool thanks for looking into this I can confirm as soon as I upgraded from 6.0.0 to 6.0.5 for fork-ts-checker-webpack-plugin it fixed it sorry I would have raised the issue there if I'd known but figuring that one out was beyond my abilities