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
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025