webpack: Cannot read property 'call' of undefined
Bug report
What is the current behavior?
There’s an issue report https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/328 on react-refresh-webpack-plugin
, and I happened to encounter it as well.
At fist glance it seems to be a bug over there, however, it might be a bug in webpack after I debug with a breakpoint.
Hence I’m reposting it here.
If the current behavior is a bug, please provide steps to reproduce.
See https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/328#issuecomment-804797961 for the steps.
What is the expected behavior?
No error should happen.
Other relevant information:
webpack version:
Node.js version:
Operating System:
Additional tools:
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 5
- Comments: 30 (14 by maintainers)
I also noticed this issue, when using
ModuleFederationPlugin
and some specific settings for thesplitChunks
.splitChunks.chunks
-> should not be set or set toasync
(default) , anything else will cause the error mentionedsplitChunks.maxSize
-> should not be set, if this is set will cause the error mentionedand It reproduces only when loading the remoteEntry on the host app. The main app does not appear to be affected.
Seeing this error in conjunction with Module Federation, though it most likely isn’t due to that alone.
Strange thing is I don’t recally seeing this on versions earlier than 5.27, but it is now constant.