Personalized checkout and custom promotions with Shopify Scripts
How can I resolve this CSP violation error on Shopify Hydrogen 2.0 and successfully add Google Fonts to my theme? I've attempted to update the style-src directive with the Google Fonts URL, but the issue persists. Any insights or guidance on adjusting the CSP settings for the Hydrogen 2.0 theme would be greatly appreciated.
Thanks in advance!
Solved! Go to the solution
This is an accepted solution.
Hey @kiran121, you can update the createContentSecurityPolicy function in entry.server.tsx file to include "fonts.googleapis.com". However, this function does not merge the directives by default. You have to define all other styleSrc directives like this.
This is an accepted solution.
Hey @kiran121, you can update the createContentSecurityPolicy function in entry.server.tsx file to include "fonts.googleapis.com". However, this function does not merge the directives by default. You have to define all other styleSrc directives like this.
Thank you , it works
its not working for me btw
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025