Closed kyoncy closed 3 years ago
Thanks for opening an issue. We've just undeprecated the package and are working on getting everything setup to continue development.
Hey folks, please see #222 for updates on v5 support.
I've read the updates and I'm happy talented people are keeping this package alive. I do however would like to suggest to re-open this issue. It seems to be still relevant for webpack V5.
[webpack-cli] TypeError: Cannot read property 'length' of undefined
at D:\Work\portal\node_modules\webpack-manifest-plugin\lib\plugin.js:129:39
at Array.reduce (<anonymous>)
at ManifestPlugin.<anonymous> (D:\Work\portal\node_modules\webpack-manifest-plugin\lib\plugin.js:116:26)
at _next0 (eval at create (D:\Work\portal\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:15:1)
at eval (eval at create (D:\Work\portal\node_modules\tapable\lib\HookCodeFactory.js:33:10), <anonymous>:35:1)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
This only happens when adding this code to webpack.config.js
plugins: [
new Manifest({
// fileName: './manifest.json',
// publicPath: '/static/react/',
}),
]
The suggestion by OP works but I don't see a PR which relates to this issue and one which is still open.
Issue seems to be webpack5. Universal chunks are not implemented yet. https://github.com/webpack/webpack/issues/11660
https://github.com/shellscape/webpack-manifest-plugin/pull/224
Any updates?
i meet this too. only with this:
new Manifest(),
Boys! It seems to be fixed https://github.com/shellscape/webpack-manifest-plugin/commit/100cbe272278fea532089393dc3445c811816005
I can confirm it works again on webpack5!
Thanks @shellscape !
Environment
webpack: v5.0.0
Error Log
add to https://github.com/shellscape/webpack-manifest-plugin/blob/master/lib/plugin.js#L127 the code below
Because of webpack changes,
chunk
is undefined.Suggestion
https://github.com/shellscape/webpack-manifest-plugin/blob/49f34a5c56db85c5076d1fae7f7be980022f932c/lib/plugin.js#L128
I suggest
chunks
tochunkNames
.Passed when using webpack@4.44.2. But, I haven't tried webpack@2.x.x, webpack@3.x.x.