-
Notifications
You must be signed in to change notification settings - Fork 798
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: Stencil 4.7.2 introduces CSP issue #5102
Comments
@plyworks Thanks for finding this! Silly mistake on my part. I published a dev build that re-orders the code for inserting those styles into the DOM if you wanna give that a try and verify it solves the issue: |
@tanner-reits thanks for your quick response! Unfortunately, i get the exact same error.
|
@plyworks Hmmm bummer. Would it be possible to get a small reproduction case? I'm not seeing anything else that would be preventing the |
Reorders the code responsible for inserting the lazy build global styles so that the nonce value is applied prior to inserting into the DOM Fixes: #5102 STENCIL-1026: Stencil 4.7.2 introduces CSP issue
* fix(runtime): apply nonce to data styles before DOM insert Reorders the code responsible for inserting the lazy build global styles so that the nonce value is applied prior to inserting into the DOM Fixes: #5102 STENCIL-1026: Stencil 4.7.2 introduces CSP issue * add note for order of operations
The fix for this was included as a part of today's v4.8.1 release! |
Prerequisites
Stencil Version
4.7.2
Current Behavior
index.js:3371 Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'nonce-myNonce' ". Either the 'unsafe-inline' keyword, a hash ('sha256-+j8iWsl9MVf18edWBLWXvGwGeA90tRYZxjJ+fI89OSY='), or a nonce ('nonce-...') is required to enable inline execution.
Expected Behavior
https://github.com/ionic-team/stencil/blob/main/src/runtime/bootstrap-lazy.ts#L209
To have the nonce attribute added tot the dataStyles before it is inserted
System Info
Steps to Reproduce
Code Reproduction URL
cannot
Additional Information
No response
The text was updated successfully, but these errors were encountered: