Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
I created an app using npm create @Shopify/hydrogen@latest. However, I have been unable to make changes or add URLs to my app's Content Security Policy. I have read through the docs https://shopify.dev/docs/custom-storefronts/hydrogen/content-security-policy and my code matches the code steps provided.
On entry.server.tsx:
const {nonce, header, NonceProvider} = createContentSecurityPolicy({styleSrc: ["'self'",'https://*.mailchimp.com',],});
Solved! Go to the solution
This is an accepted solution.
You're adding mailchimp.com to the `styleSrc` directive. It will only allow loading stylesheet URLs. You might need to add it to `defaultSrc` or `scriptSrc` instead.
This is an accepted solution.
You're adding mailchimp.com to the `styleSrc` directive. It will only allow loading stylesheet URLs. You might need to add it to `defaultSrc` or `scriptSrc` instead.
Ah I see. Thanks for the help. I ended up needing to use 'defaultSrc' and 'connectSrc' for what I was using in my app.