我有一个角度4的应用程序与一些懒惰的加载路线。 webapp部署在wildfly服务器上。 通常当我更新软件包并尝试使用应用程序时,我会得到这个
7.67f0bdb1c002c6632088.chunk.js无法加载资源:服务器响应状态为404(未找到) vendor.bb65efd8883ae143b006.bundle.js:1错误错误:未捕获(在 promise):错误:加载块7失败。错误:加载块7 失败。在HTMLScriptElement.n (inline.c073b632003c3be717dd.bundle.js:1)在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)在r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1)在e.invokeTask [as 调用](polyfills.3d0670849efe6dd6a541.bundle.js:1)在W (polyfills.3d0670849efe6dd6a541.bundle.js:1)在HTMLScriptElement.q (polyfills.3d0670849efe6dd6a541.bundle.js:1)在HTMLScriptElement.n (inline.c073b632003c3be717dd.bundle.js:1)在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)在r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1)在e.invokeTask [as 调用](polyfills.3d0670849efe6dd6a541.bundle.js:1)在W (polyfills.3d0670849efe6dd6a541.bundle.js:1)在HTMLScriptElement.q (polyfills.3d0670849efe6dd6a541.bundle.js:1)在你 (polyfills.3d0670849efe6dd6a541.bundle.js:1)在你 (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)在r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1)在o (polyfills.3d0670849efe6dd6a541.bundle.js:1)在e.invokeTask [as 调用](polyfills.3d0670849efe6dd6a541.bundle.js:1)在W (polyfills.3d0670849efe6dd6a541.bundle.js:1)w @ vendor.bb65efd8883ae143b006.bundle.js:1 7.67f0bdb1c002c6632088.chunk.js无法加载资源:服务器响应状态为404(未找到) vendor.bb65efd8883ae143b006.bundle.js:1错误错误:未捕获(在 promise):错误:加载块7失败。错误:加载块7 失败。在HTMLScriptElement.n (inline.c073b632003c3be717dd.bundle.js:1)在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)在r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1)在e.invokeTask [as 调用](polyfills.3d0670849efe6dd6a541.bundle.js:1)在W (polyfills.3d0670849efe6dd6a541.bundle.js:1)在HTMLScriptElement.q (polyfills.3d0670849efe6dd6a541.bundle.js:1)在HTMLScriptElement.n (inline.c073b632003c3be717dd.bundle.js:1)在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)在r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1)在e.invokeTask [as 调用](polyfills.3d0670849efe6dd6a541.bundle.js:1)在W (polyfills.3d0670849efe6dd6a541.bundle.js:1)在HTMLScriptElement.q (polyfills.3d0670849efe6dd6a541.bundle.js:1)在你 (polyfills.3d0670849efe6dd6a541.bundle.js:1)在你 (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)在r.runTask (polyfills.3d0670849efe6dd6a541.bundle.js:1)在o (polyfills.3d0670849efe6dd6a541.bundle.js:1)在e.invokeTask [as 调用](polyfills.3d0670849efe6dd6a541.bundle.js:1)在W (polyfills.3d0670849efe6dd6a541.bundle.js:1)w @ vendor.bb65efd8883ae143b006.bundle.js:1
我确定这是一个浏览器缓存问题,因为如果按ctrl + shift + F5,应用程序运行正常。
那么我可以使缓存浏览器无效吗?或者在文件名中添加版本/时间戳?
非常感谢 ˚F
答案 0 :(得分:0)
我尝试更好地解释我的问题以获得此错误.. 我在Wildfly上运行了ng应用程序,并在war文件中构建。
我几乎可以肯定问题是浏览器缓存...而且我对解决它的解决方法一无所知。
答案 1 :(得分:0)
有一个很好的描述来解释问题
https://medium.com/@kamrankhatti/angular-lazy-routes-loading-chunk-failed-42b16c22a377
答案 2 :(得分:0)
我通过从当前版本降级解决了这个问题。你可以看到更多 Angular 5 with Angular cli non-lazy loading modules in the router