shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.44k stars 185 forks source link

Missing manifest.json file when first build of webpack-dev-server is failed #155

Closed m-ermolaev closed 3 years ago

m-ermolaev commented 6 years ago

Hi!

I've noticed that if my first build of webpack-dev-server fails, then no manifest.json file is emitted.

On succeeded initial build works ok - even if build fails during development, manifest.json file will still be updated after successful build.

On failed initial build manifest.json file does not exist until restarting webpack-dev-server.

Do you know why this can happen?

mastilver commented 6 years ago

Hi

Is that only with webpack-dev-server? Do you get the same with vanilla webback?

Do you mind creating a simple repository where your issue is reproducible?

mastilver commented 6 years ago

Just in case, its the same issue as #144 (I doubt it), can you try installing danethurber/webpack-manifest-plugin#80c01c5dd2aac751ea49bfa1b9ddac26fc35bf44

zhbhun commented 6 years ago

https://github.com/danethurber/webpack-manifest-plugin/blob/master/lib/plugin.js#L173

With NoEmitOnErrorsPlugin, emitCount will always larger than 0 while webpack fail compile once.

manubo commented 4 years ago

I was having the issue that the manifest.json was not being serialized after fixing a previous compilation error. Debugging showed that on emits following a compilation error, emitCount was not 0 (it was 1 in this specific case).

As @zhbhun pointed out, removing the NoEmitOnErrorsPlugin fixed the issue. This happened on versions 2.2.0 and 3.0.0-rc0.

bogn83 commented 4 years ago

https://github.com/danethurber/webpack-manifest-plugin/blob/master/lib/plugin.js#L173

With NoEmitOnErrorsPlugin, emitCount will always larger than 0 while webpack fail compile once.

@zhbhun maybe you already know it, but it's quite helpful to link to GitHub code with specific revisions and way too few people do it, just press y on your keyboard before copying the browser URL and GitHub will replace the branch name in the URL with what explicit revision this currently points to.

I could likely find the right version (2.0.4) you referred to with your link.

zhbhun commented 4 years ago

@manubo Thanks for your suggestion, let me acquire a new skill😄. BTW, 2.0.4 is right version, thank you!

jkevingutierrez commented 3 years ago

Having the same issue with webpack-dev-server. It works well when I run vanilla webpack

shellscape commented 3 years ago

As I mentioned here (https://github.com/shellscape/webpack-manifest-plugin/issues/220#issuecomment-714921324), issues with webpack-dev-server that don't also appear when using webpack via CLI should be reported with webpack-dev-server.

I would also suggest giving webpack-plugin-serve a try. For most users, it's a superior experience https://github.com/shellscape/webpack-plugin-serve