无法注册 ServiceWorker - Angular,Express

Failed to register a ServiceWorker - Angular, Express

我正在通过 HTTPS 中的 Express 服务器为我的 angular 应用提供服务(用于启用 PWA)。在我的开发环境中,我能够使用相同的服务器和 angular 代码获得 PWA。但是在更高的环境中收到这样的错误

ERROR Error: Uncaught (in promise): AbortError: Failed to register a ServiceWorker for scope ('https://xx.xx.xx.xxx:yyyy/') with script ('https://xx.xx.xx.xxx:yyyy/ngsw-worker.js'): An unknown error occurred when fetching the script.
 at O (polyfills.d1c7bf4a2ae7c3435f95.js:1)
    at polyfills.d1c7bf4a2ae7c3435f95.js:1
    at polyfills.d1c7bf4a2ae7c3435f95.js:1
    at e.invoke (polyfills.d1c7bf4a2ae7c3435f95.js:1)
    at Object.onInvoke (main.e1811227a8dd47dc4199.js:1)
    at e.invoke (polyfills.d1c7bf4a2ae7c3435f95.js:1)
    at t.run (polyfills.d1c7bf4a2ae7c3435f95.js:1)
    at polyfills.d1c7bf4a2ae7c3435f95.js:1
    at e.invokeTask (polyfills.d1c7bf4a2ae7c3435f95.js:1)
    at Object.onInvokeTask (main.e1811227a8dd47dc4199.js:1)

当我使用自签名证书时,我收到了该错误。添加有效证书后,它按预期工作。