modify-source-webpack-plugin icon indicating copy to clipboard operation
modify-source-webpack-plugin copied to clipboard

Incompatibility with webpack v >= 5.66.0

Open mdudek opened this issue 3 years ago • 2 comments

[DEP_WEBPACK_COMPILATION_NORMAL_MODULE_LOADER_HOOK] DeprecationWarning: Compilation.hooks.normalModuleLoader was moved to NormalModule.getCompilationHooks(compilation).loader (Use node --trace-deprecation ...` to show where the warning was created) c:\sources\xxx\node_modules\webpack\lib\NormalModule.js:207 throw new TypeError( ^

TypeError: The 'compilation' argument must be an instance of Compilation at Function.getCompilationHooks (c:\sources\xxx\node_modules\webpack\lib\NormalModule.js:207:10) at c:\sources\xxx\node_modules\modify-source-webpack-plugin\build\ModifySourcePlugin.js:80:40 at Hook.eval [as call] (eval at create (c:\sources\xxx\node_modules\tapable\lib\HookCodeFactory.js:19:10), :238:1) at Hook.CALL_DELEGATE [as _call] (c:\sources\xxx\node_modules\tapable\lib\Hook.js:14:14) at Compiler.newCompilation (c:\sources\xxx\node_modules@angular-devkit\build-angular\node_modules\webpack\lib\Compiler.js:1055:26) at c:\sources\xxx\node_modules@angular-devkit\build-angular\node_modules\webpack\lib\Compiler.js:1099:29 at eval (eval at create (c:\sources\xxx\node_modules\tapable\lib\HookCodeFactory.js:33:10), :31:1) `

mdudek avatar Jan 26 '22 07:01 mdudek

I have found that this error occurred because of having different "webpack" versions installed in 2 places:

c:\sources\xxx\node_modules\webpack c:\sources\xxx\node_modules@angular-devkit\build-angular\node_modules\webpack

mdudek avatar Jan 26 '22 08:01 mdudek

Hi! Thank you for reporting this. I'll try to reproduce it later but it's would be good if you will you provide the minimal reproduction example.

artembatura avatar Jan 26 '22 09:01 artembatura

Wasn't able to reproduce it from my side. So, if it's still relevant please provide more information and reopen

artembatura avatar Feb 11 '23 15:02 artembatura