Custom Form with Formik and material-ui

Hey,

so I’m trying to build a custom form using formik and material-ui for a JIRA App. The problem now is that the styles don’t seem to get loaded.
I get the following error in the console:

“Refused to apply inline style because it violates the following Content Security Policy directive: “style-src ‘self’”. Either the ‘unsafe-inline’ keyword, a hash (‘sha256-daEdpEyAJIa8b2VkCqSKcw8PaExcB6Qro80XNes/sHA=’), or a nonce (‘nonce-…’) is required to enable inline execution.”

Is there a way to fix this?

1 Like

Hi @FilippoMatraxia,

This sounds a lot like you’re running in to the issue mentioned here. You should be able to fix this by putting this code:

<meta
  http-equiv="Content-Security-Policy"
  content="style-src 'unsafe-inline' 'self'"
/>

Inside the <head> of your HTML document. Hope this helps!

Cheers,
Sven

2 Likes

Thank you! It works

1 Like

As the document says, you should use the new method from now on: https://developer.atlassian.com/platform/forge/add-content-security-and-egress-controls/#add-content-security-and-egress-controls