Questions tagged «angular-service-worker»

1
Angular Service Worker-无法加载资源:服务器响应状态为504(网关超时)
我在我们的应用程序中使用Angular-CLI 1.6.6和。除了在我们的生产环境中弹出一条错误消息外,一切都可以在本地lite服务器和生产服务器上正常运行:@angular/service-worker 5.2.5Angular 5.2.5 加载资源失败:服务器响应状态为504(网关超时) 查看ngsw-worker.js脚本,我发现生成上面错误消息的行(以下是2466): async safeFetch(req) { try { return await this.scope.fetch(req); } catch (err) { this.debugger.log(err, `Driver.fetch(${req.url})`); return this.adapter.newResponse(null, { status: 504, statusText: 'Gateway Timeout', }); } } 捕获中的控制台日志错误er发出以下错误: TypeError: Failed to execute 'fetch' on 'ServiceWorkerGlobalScope': 'only-if-cached' can be set only with 'same-origin' mode at Driver.safeFetch (ngsw-worker.js:2464) …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.