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

[BUG] CSP breaks, styles are injected even after disableStyleInjection is used #1165

Open
madhukivera opened this issue Feb 6, 2024 · 2 comments
Labels
Bug Information Needed Stale This has not seen activity in quite some time

Comments

@madhukivera
Copy link

Bug description

While #1059 claims the disableStyleInjection works. However it does not
Even after sending 'core' | 'true' as values, the library still injects styles, causing issues with CSP. Only after adding 'unsafe-inline' the errors go away, which seems to defeat the purpose of CSP

Version of Package
^5.25.2

To Reproduce
Add CSP to webpage
Send disableStyleInjection = 'core' or true

Expected behavior

We should not add 'unsafe-inline' to CSP

@madhukivera madhukivera added the Bug label Feb 6, 2024
@gabrieljablonski
Copy link
Member

disableStyleInjection should work as expected. The error you're seeing is probably due to using import "react-tooltip/dist/react-tooltip.css";.

How are you injecting CSS styles into your application? Instead of importing the react-tooltip.css file, you might need to copy its content manually to your own CSS files (try copying from node_modules/react-tooltip/dist/react-tooltip.css).

Copy link

github-actions bot commented May 9, 2024

This issue is stale because it has not seen activity in 30 days. Remove the stale label or comment within 14 days, or it will be closed.

@github-actions github-actions bot added the Stale This has not seen activity in quite some time label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Information Needed Stale This has not seen activity in quite some time
Projects
None yet
Development

No branches or pull requests

2 participants