Https://ic0.app is not defined in .ic-assets.json5 initially

Hi, ICP developer community,

I’ve been stuck for a few hours on this frontend error.

start.6bc19524.js:1 Refused to connect to 'https://ic0.app/api/v2/canister/be2us-64aaa-aaaaa-qaabq-cai/call' because it violates the following Content Security Policy directive: "connect-src 'self' http://localhost:* https://icp0.io https://*.icp0.io https://icp-api.io".

Even after adding CSP to the meta tag, the error persisted. This issue was caused by the .ic-assets.json5 configuration.

Since icp.app is utilized for II canister and other calls, others might encounter the same issue.

By adding https://ic0.app to the connect-src directive in it like so:

connect-src 'self' http://localhost:* https://icp0.io https://*.icp0.io https://ic0.app

this error can be resolved.

Thanks!

1 Like