merge-jsons-webpack-plugin icon indicating copy to clipboard operation
merge-jsons-webpack-plugin copied to clipboard

Incompatibility with Webpack 5

Open GorvGoyl opened this issue 4 years ago • 3 comments

I'm not able to run webpack in development mode when source-map is enabled and set to cheap-module-source-map or inline-source-map. On digging I found out your plugin is not fully compatible with webpack v5 which is causing that issue. To test: node --trace-deprecation node_modules/webpack/bin/webpack.js Output:

(node:14444) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
        Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
        Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
    at MergeJsonWebpackPlugin.addAssets (C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\merge-jsons-webpack-plugin\index.js:234:42)
    at C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\merge-jsons-webpack-plugin\index.js:38:30
    at tryCatch (C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\es6-promise\dist\lib\es6-promise\-internal.js:195:12)   
    at invokeCallback (C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\es6-promise\dist\lib\es6-promise\-internal.js:210:13)
    at publish (C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\es6-promise\dist\lib\es6-promise\-internal.js:178:7)     
    at flush (C:\Users\1gour\OneDrive\Documents\old\Github\Notion-Boost-browser-extension\node_modules\es6-promise\dist\lib\es6-promise\asap.js:98:5)
    at processTicksAndRejections (internal/process/task_queues.js:76:11)

You can see that webpack config file: https://github.com/GorvGoyl/Notion-Boost-browser-extension/blob/72c0da7202b2cbcd6006d553fe59035abdb8d9e4/webpack.config.js#L217

steps to reproduce:

  • Clone https://github.com/GorvGoyl/Notion-Boost-browser-extension/tree/webpack5_devtool_bug
  • npm install
  • run webpack in development mode npm run start:ch
  • build would fail with above error.

Other relevant information: webpack version: 5.6.0 Node.js version: 12.15.0 Operating System: Win10 Additional tools: Powershell Core, VSCode

I previously filed this bug for Webpack https://github.com/webpack/webpack/issues/12041

GorvGoyl avatar Nov 23 '20 15:11 GorvGoyl

@GorvGoyl published new version 2.0.0-alpha, however it has some breaking changes in case of array behaviour, you can check read me file

aarthishuba avatar Dec 29 '20 15:12 aarthishuba

Even with the new version 2.0.0-alpha, I still get the warning on my project. It's not a big deal so far :)

HoneyBadgerSeeker avatar Jul 29 '21 12:07 HoneyBadgerSeeker

Hey! Any updates on this? I found a couple of related issues on html-webpack-plugin that were fixed already in case that helps.

ybentz avatar Sep 10 '21 18:09 ybentz