Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use react-apexcharts with the template #142

Open
imyosh opened this issue May 4, 2023 · 1 comment
Open

Unable to use react-apexcharts with the template #142

imyosh opened this issue May 4, 2023 · 1 comment

Comments

@imyosh
Copy link

imyosh commented May 4, 2023

Please provide the following information:

Operating system: ubuntu 23
Version of the template: v22

MVP:
simply by installing react-apexcharts and importing/using one of the charts in the renderer process

Error message:

Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' 'nonce-jSijahJoqaar+eujhthsIA=='". Either the 'unsafe-inline' keyword, a hash ('sha256-0LPZoaUlRg6skhVDAsOXJDYd0QywFnns8TclTlStHUs='), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present.

What I've tried :

  • Adding 'unsafe-inline' does not solve the issue
  • I tried the solutions suggested in similar issue ( the styled component and material-ui ) but does not solve this one.

how react-apexcharts works is kinda similar to material-ui as it injects style tag to the header

currently the only way to get through this is by removing the whole CspHtmlWebpackPlugin, which defeat the purpose of the template

Any help will be appreciated

@reZach
Copy link
Owner

reZach commented Nov 3, 2023

Do you have a sample git repo that reproduces the issue @imyosh ? That would be helpful in debugging and validating a fix is successful when made. I would have thought adding "unsafe-inline" too would fix the issue, but perhaps there is more integration with the react-apexcharts library needs to be made in order to work with this template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants