CSP error on default fonts #85452
Unanswered
fortinlouis
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I am trying to set up a CSP policy. Since I am using MUI Components, I added a nonce (that I wrote in my .env for now)
Here is my middleware :
I'm getting my nonce in my app/layout.tsx component so I an pass it to mui. I also generate my local fonts in this component :
And I use ThemeRegistry to set up my emotionCache :
Despite all my efforts, I still have many errors in my console :
Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'nonce-ODk1OWJkMDItODUxZS00OTNlLWIzNWYtMGEzMzA5NDM4NTE1'". Either the 'unsafe-inline' keyword, a hash ('sha256-XbNwOSjMIgSNj3ewh1FPDgy/T33iTuvdeceTh/VSFZg='), or a nonce ('nonce-...') is required to enable inline execution.Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'nonce-ODk1OWJkMDItODUxZS00OTNlLWIzNWYtMGEzMzA5NDM4NTE1'". Either the 'unsafe-inline' keyword, a hash ('sha256-tzBMNZ7l8nZ/8oEITbEGeJAgNHg7KpJOduvhc+LO138='), or a nonce ('nonce-...') is required to enable inline execution.I don't know where these a from. The only clue I have is this <style> tag with no nonce in the header that contains the default Geist font from Next. But since I set up a local font, I do not expect to see it in my header ...
What do you think ? Any clue or recommandation ? Help would be appreciated
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions