MSW - 模拟服务人员 - “操作已中止”
我在使用库 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
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
转到 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: