首页 > 解决方案 > Parcel Bundler 给出内容安全策略错误

问题描述

每次我捆绑(包裹)我的项目时,我总是收到一条错误消息...

Refused to connect to 'ws://localhost:#####/' because it violates the following Content Security Policy

这迫使我每次都更新元标记中的 connect-src 属性以使其正常工作。但是,每次我执行新的 npm run start 时,我是否可以避免这种情况发生?或者这就是它应该的样子?

标签: javascriptbundlercontent-security-policyparceljs

解决方案


推荐阅读