For questions please post on Stack Overflow and use the 'webpack' tag (http://stackoverflow.com/tags/webpack).
sokra on main
chore: add bugs field in packag… Merge pull request #15940 from … (compare)
sokra on main
ci: update github actions Merge pull request #15834 from … (compare)
sokra on main
fix: hmr build twice fix registry Merge pull request #15909 from … (compare)
sokra on main
enhanced-resolve@5.10.0 Merge pull request #16001 from … (compare)
sokra on up-enhanced-resolve
sokra on main
remove unnecessary moduleId pro… Merge pull request #16005 from … (compare)
sokra on moduleId-prop
Is there some callback or Event in webpack to know when a module or chunk has failed to load in the browser?
I know that webpack can tell you that a certain module is not found when bundling, but suppose you make some changes to the scripts, but a user is already in the webapp... then the chunk names that were bundled earlier will not be found.
Below is such error that will appear:
fb81469e-872e-4459-b2ba-91ebfaf50d48.js:106 Uncaught (in promise) ChunkLoadError: Loading chunk 28 failed.
hot: false
on devServer but I'm still getting an error about sockjs
@johnmarinelli maybe i was not clear in my description. The thing is, there are several times when a chunk will not be found, like when there is no network, or the server is down, or the chunk that was meant to be loaded dynamically has been deleted at the server, or the chunk that was meant to be loaded dynamically has been replaced by another update/build from a security update to the code.
The last two cases will occur if the client/user was already in the browser, but they attempt to go the page that requires the chunk that is no longer there... so, boom... the chunk cant be loaded... now, i needed to catch that error that the chunk cant be loaded, which i figured out, see https://stackoverflow.com/a/57860730/3563013
libraryTarget: 'umd'
, because the docs says, "To make the library compatible with other environments, add libraryTarget property to the config. This will add various options about how the library can be exposed."
output: {
// ...
globalObject: "this"
}