webpackJsonpCallback is not called when I navigate to a new page #17543
Replies: 1 comment 2 replies
|
Okay, it seems that the issue is related to |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I am facing a weird issue when I try to load new chunks while navigating to a new page, which I am not sure what's the root cause of it. I have implemented code splitting in my app and the build runs okay, the chunks are created and the app loads fine on the initial load. However, when I navigate to a new page, the app fails with a
ChunkLoaderror. Initially, I thought that the location of the chunks was invalid, which I checked, but it seems alright. The HTTP calls on the network tab also show a 200 status code. I need to mention that the app runs on dev mode, which cancels any scenario of a caching issue.I spent a bit of time reading the build code and I noticed that
webpackJsonpCallbackis never called when I move to a new page, which is not the case when the app loads for a first time. If I understood correctly,webpackJsonpCallbackis responsible for registering a chunk in the modules andinstalledChunksstores. If the chunk doesn't exists ininstalledChunks, it is marked as failure by theloadingEndedcallback, which runs as soon as the chunk loading is done.__webpack_require__.f.jis the method responsible for creating the JSONP script, injecting it to the DOM and attaching theloadingEndedcallback.Can anyone think of reason why
webpackJsonpCallbackis never called when I navigate to a new page?All reactions