MSW - 模拟服务人员 - “操作已中止”

发布于 2025-01-17 06:05:18 字数 554 浏览 4 评论 0原文

我在使用库 msw 时遇到了此错误。

[MSW] Failed to register the Service Worker:
Failed to register a ServiceWorker for scope ('http://localhost:3000/') with script ('http://localhost/mockServiceWorker.js'): Operation has been aborted

输入图片此处的描述

重要的是,如果我使用其他浏览器或不同的 Chrome 配置文件,它会正常工作

我尝试清除缓存,但这没有帮助。如何解决这个问题?

I ran into this error when using the library msw.

[MSW] Failed to register the Service Worker:
Failed to register a ServiceWorker for scope ('http://localhost:3000/') with script ('http://localhost/mockServiceWorker.js'): Operation has been aborted

enter image description here

An important thing is, if I use another browser or a different Chrome profile, it'll work just fine.

I tried clearing cache but that doesn't help. How to resolve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

带上头具痛哭 2025-01-24 06:05:18

转到 chrome://flags/#allow-insecure-localhost,将“允许从本地主机加载的资源使用无效证书”设置为启用


我通过此搜索解决了问题:在此处输入图像描述

Go to chrome://flags/#allow-insecure-localhost, set "Allow invalid certificates for resources loaded from localhost" to Enabled.


I resolved the issue with this search:enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文