You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
styles are broken in development. Getting the following browser console errore:
Content-Security-Policy: Ignoring “'unsafe-inline'” within style-src: nonce-source or hash-source specified
Content-Security-Policy: The page’s settings blocked an inline style (style-src-elem) from being applied because it violates the following directive: “style-src 'self' https: 'unsafe-inline' 'nonce-hlKBeGISpbxAy7igRiyz2w=='”
It appears that, if the CSP contains a nonce, then unsafe-* declarations are ignored. And because of this, all the <style> tags that vite is injecting are not able to load.
When I comment out content_security_policy_nonce_generator, then everything works as expected.
Reproduction 🐞
Please provide a link to a repo that can reproduce the problem you ran into.
bundle update vite_ruby
.Description 📖
With the following in the Rails content_security_policy.rb:
styles are broken in development. Getting the following browser console errore:
It appears that, if the CSP contains a nonce, then unsafe-* declarations are ignored. And because of this, all the <style> tags that vite is injecting are not able to load.
When I comment out
content_security_policy_nonce_generator
, then everything works as expected.Reproduction 🐞
Please provide a link to a repo that can reproduce the problem you ran into.
Vite Ruby Info
Run
bin/rake vite:info
and provide the output:The text was updated successfully, but these errors were encountered: