webpack: Uncaught (in promise) Error: Loading chunk # failed.
Bug report
Uncaught (in promise) Error: Loading chunk # failed.
after rolling update.
What is the current behavior?
I have a kubernetes cluster with a couple of pods running an image of a web app build with webpack. When I build a new image and deploy it to the pods (rolling update), the web app can’t be loaded and I get error: Uncaught (in promise) Error: Loading chunk <whatever chunk number> failed.
in web browser console after reloading the web app.
If the current behavior is a bug, please provide the steps to reproduce. Basically, webpack runs on Google container builder. The web app is built with docker. Once the docker build is done, the image with the new build of the web app is deployed to kubernetes (rolling update). While new pods are created and running with the new version of the web app can’t be loaded.
What is the expected behavior? The web app should load smoothly update after update.
Other relevant information: webpack version: 4.11.1 Node.js version: 8.11 Operating System: CoreOS Additional tools: Docker, Kubernetes (on Google Cloud)
PS: Actually I am not 100% sure if this is a problem directly link to webpack but a combinaison with kubernetes. As I am writing this bug report, I sort figured out the rolling update might the problem as two different versions of the web app is living as long all the pods are not using the last image.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 20
- Comments: 34 (4 by maintainers)
+1
I’m also having this issue too
This happens if a chunk could not be loaded, which will happen more often on mobile due to poor connections. You need to have some error handling in case a chunk failed to load, such as asking the user to reload the page.
We are seeing this issue in our sentry from iOs mobile safari users. It doesn’t seem related to the version of iOs or safari. It certainly seems like an issue with webpack itself.
Its very hard to debug as its not happening consistently. Here is our webpack config / dependencies in package.json, hope it helps:
Same issue.
It is network problem. Better solution is not use lazy load modules 😊
От: 离上的风 notifications@github.com Отправлено: Monday, December 3, 2018 7:28:45 AM Кому: webpack/webpack Копия: Sergey S. Volkov; Mention Тема: Re: [webpack/webpack] Uncaught (in promise) Error: Loading chunk # failed. (#7502)
Have any methods for it?I have same issue
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/webpack/webpack/issues/7502#issuecomment-443585515, or mute the threadhttps://github.com/notifications/unsubscribe-auth/APlXr_NBkbBm7H8zg1ybuwZpMM5SUX2fks5u1Kh9gaJpZM4Ue2ZF.
Just experienced the same problem with the ‘Missing Chunk’ Console Error in Chrome. This was a lazy loaded component that I recently made changes to and was unable to access it in my browser to verify the view. Was going a bit nuts trying to track down the problem when all I had to do was do a ‘Empty Cache and Hard Reload’ in Chrome (even though I already had my Dev Tools open with Cache disabled) which solved my ‘Missing Chunk’ issue.
@realalexhomer @jacobrask Thanks guys, I think I will keep in the server always one version back. that way I reduce the chances of it to happen (still can happen if we push 2 new versions in small window of time but the chances are like 0.1%).
by the way @jacobrask how can catch that kind of error so ill be able to pop a message?