问题
有一个使用Service Worker的通用应用程序。
最近从Angular 6.1升级到7。
将更新后的文件上传到服务器后:
细节:
The script has an unsupported MIME type ('text/html').
Failed to load resource: net::ERR_INSECURE_RESPONSE
main.2733b77522d2feee4713.js:1 ERROR Error: Uncaught (in promise): SecurityError: Failed to register a ServiceWorker: The script has an unsupported MIME type ('text/html').
at j (polyfills.92108b287fe28032870b.js:1)
at polyfills.92108b287fe28032870b.js:1
at polyfills.92108b287fe28032870b.js:1
at e.invoke (polyfills.92108b287fe28032870b.js:1)
at Object.onInvoke (main.2733b77522d2feee4713.js:1)
at e.invoke (polyfills.92108b287fe28032870b.js:1)
at t.run (polyfills.92108b287fe28032870b.js:1)
at polyfills.92108b287fe28032870b.js:1
at e.invokeTask (polyfills.92108b287fe28032870b.js:1)
at Object.onInvokeTask (main.2733b77522d2feee4713.js:1)
Sr @ main.2733b77522d2feee4713.js:1
t.handleError @ main.2733b77522d2feee4713.js:1
...
(anonymous) @ main.2733b77522d2feee4713.js:1
The script has an unsupported MIME type ('text/html').
Failed to load resource: net::ERR_INSECURE_RESPONSE
The script has an unsupported MIME type ('text/html').
Failed to load resource: net::ERR_INSECURE_RESPONSE
SSL
使用由https://letsencrypt.org/生成的有效证书。