【问题标题】:Angular universal + pwa ERROR { Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'ngsw_worker.es6.js.map'Angular Universal + pwa ERROR { 错误:未捕获(承诺中):错误:无法匹配任何路由。 URL 段:'ngsw_worker.es6.js.map'
【发布时间】:2018-07-20 17:21:45
【问题描述】:

我已经设置了一个通用和 pwa 应用程序。

有没有办法解决这个错误?

你可以看一个DEMO(第一次推送:))https://blogial-client.herokuapp.com/

服务器端控制台

ERROR { Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'ngsw_worker.es6.js.map'
Error: Cannot match any routes. URL Segment: 'ngsw_worker.es6.js.map'

Chrome 控制台

ERROR Error: Uncaught (in promise): SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/html').

更新

我用

解决了
ng add @angular/pwa --project *project-name*

我忘记了应用名称:(

【问题讨论】:

    标签: angular angular-universal pwa angular-pwa


    【解决方案1】:

    我从dist/appname/ngsw-worker.js 中删除了"//# sourceMappingURL=ngsw_worker.es6.js.map",它正在工作。

    这似乎是一个错误。

    【讨论】:

    • 感谢您的回复,但使用 angular 6 我的服务器和浏览器的 dist 文件夹中都没有 ngsw-worker.js 文件
    【解决方案2】:

    以上所有方法都不适合我。
    起作用的是在浏览器上“取消注册”服务工作者。
    似乎问题是以前在同一 url:port 上为应用程序服务的服务人员。

    【讨论】:

      猜你喜欢
      • 2022-06-14
      • 2019-10-14
      • 1970-01-01
      • 2018-08-22
      • 2022-11-10
      • 1970-01-01
      • 2018-09-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多