I have an angular 4 app with some lazy loading routes. The webapp is deployed on a wildfly server. Often when I update the package and try to use the app I get this
7.67f0bdb1c002c6632088.chunk.js Failed to load resource: the server responded with a status of 404 (Not Found) vendor.bb65efd8883ae143b006.bundle.js:1 ERROR Error: Uncaught (in promise): Error: Loading chunk 7 failed. Error: Loading chunk 7 failed. at HTMLScriptElement.n (inline.c073b632003c3be717dd.bundle.js:1) at HTMLScriptElement.o (polyfills.3d0670849efe6dd6a541.bundle.js:1) at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at Object.onInvokeTask (vendor.bb65efd8883ae143b006.bundle.js:1) at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at e.invokeTask [as invoke] (polyfills.3d0670849efe6dd6a541.bundle.js:1) at W (polyfills.3d0670849efe6dd6a541.bundle.js:1) at HTMLScriptElement.q (polyfills.3d0670849efe6dd6a541.bundle.js:1) at HTMLScriptElement.n (inline.c073b632003c3be717dd.bundle.js:1) at HTMLScriptElement.o (polyfills.3d0670849efe6dd6a541.bundle.js:1) at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at Object.onInvokeTask (vendor.bb65efd8883ae143b006.bundle.js:1) at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at e.invokeTask [as invoke] (polyfills.3d0670849efe6dd6a541.bundle.js:1) at W (polyfills.3d0670849efe6dd6a541.bundle.js:1) at HTMLScriptElement.q (polyfills.3d0670849efe6dd6a541.bundle.js:1) at u (polyfills.3d0670849efe6dd6a541.bundle.js:1) at u (polyfills.3d0670849efe6dd6a541.bundle.js:1) at polyfills.3d0670849efe6dd6a541.bundle.js:1 at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at Object.onInvokeTask (vendor.bb65efd8883ae143b006.bundle.js:1) at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at o (polyfills.3d0670849efe6dd6a541.bundle.js:1) at e.invokeTask [as invoke] (polyfills.3d0670849efe6dd6a541.bundle.js:1) at W (polyfills.3d0670849efe6dd6a541.bundle.js:1) w @ vendor.bb65efd8883ae143b006.bundle.js:1 7.67f0bdb1c002c6632088.chunk.js Failed to load resource: the server responded with a status of 404 (Not Found) vendor.bb65efd8883ae143b006.bundle.js:1 ERROR Error: Uncaught (in promise): Error: Loading chunk 7 failed. Error: Loading chunk 7 failed. at HTMLScriptElement.n (inline.c073b632003c3be717dd.bundle.js:1) at HTMLScriptElement.o (polyfills.3d0670849efe6dd6a541.bundle.js:1) at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at Object.onInvokeTask (vendor.bb65efd8883ae143b006.bundle.js:1) at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at e.invokeTask [as invoke] (polyfills.3d0670849efe6dd6a541.bundle.js:1) at W (polyfills.3d0670849efe6dd6a541.bundle.js:1) at HTMLScriptElement.q (polyfills.3d0670849efe6dd6a541.bundle.js:1) at HTMLScriptElement.n (inline.c073b632003c3be717dd.bundle.js:1) at HTMLScriptElement.o (polyfills.3d0670849efe6dd6a541.bundle.js:1) at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at Object.onInvokeTask (vendor.bb65efd8883ae143b006.bundle.js:1) at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at e.invokeTask [as invoke] (polyfills.3d0670849efe6dd6a541.bundle.js:1) at W (polyfills.3d0670849efe6dd6a541.bundle.js:1) at HTMLScriptElement.q (polyfills.3d0670849efe6dd6a541.bundle.js:1) at u (polyfills.3d0670849efe6dd6a541.bundle.js:1) at u (polyfills.3d0670849efe6dd6a541.bundle.js:1) at polyfills.3d0670849efe6dd6a541.bundle.js:1 at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at Object.onInvokeTask (vendor.bb65efd8883ae143b006.bundle.js:1) at t.invokeTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1) at o (polyfills.3d0670849efe6dd6a541.bundle.js:1) at e.invokeTask [as invoke] (polyfills.3d0670849efe6dd6a541.bundle.js:1) at W (polyfills.3d0670849efe6dd6a541.bundle.js:1) w @ vendor.bb65efd8883ae143b006.bundle.js:1
I'm sure that is a browser cache issue because if I press ctrl+shift+F5 the app works fine.
So can I invalidate the cache browser? Or add a version/timestamp to the file name?
Thanks a lot F
There is a good description that explains the problem
https://medium.com/@kamrankhatti/angular-lazy-routes-loading-chunk-failed-42b16c22a377