shellscape / webpack-manifest-plugin

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

TypeError: The 'compilation' argument must be an instance of Compilation #292

Closed tarkhil closed 2 years ago

tarkhil commented 2 years ago

Added plugin to the very basic working Vue config, got error

The code is just a Vue boilerplate created by vue3-cli

Expected Behavior

Compiled files, produced manifest

Actual Behavior

tarkhil@payments:~/payments % webpack build --mode=development
[webpack-cli] TypeError: The 'compilation' argument must be an instance of Compilation
    at Function.getCompilationHooks (/usr/home/tarkhil/payments/node_modules/webpack/lib/NormalModule.js:227:10)
    at /usr/home/tarkhil/payments/node_modules/webpack-manifest-plugin/dist/index.js:57:42
    at _next28 (eval at create (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:50:1)
    at _next6 (eval at create (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:97:1)
    at Hook.eval [as call] (eval at create (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:113:1)
    at Hook.CALL_DELEGATE [as _call] (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Hook.js:14:14)
    at Compiler.newCompilation (/usr/local/lib/node_modules/webpack/lib/Compiler.js:1122:26)
    at /usr/local/lib/node_modules/webpack/lib/Compiler.js:1166:29
    at Hook.eval [as callAsync] (eval at create (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/usr/local/lib/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)

Additional Information

tarkhil commented 2 years ago

Repeats with different manifest plugin, should be rather a Webpack issue

shellscape commented 2 years ago

No reproduction, so we can't triage.

nskazki commented 1 year ago

Had the same problem. For me, the reason was two Webpack versions installed in the same project.

jgibbes commented 1 year ago

Had the same problem. For me, the reason was two Webpack versions installed in the same project.

how can i check this en fix it?

yinsang commented 11 months ago
rm -rf node_modules && npm i 

resolve this problem but I don't know why.