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
I have searched for existing issues that already report this problem, without success.
Stencil Version
4.12.6
Current Behavior
I encountered an issue where the nonce attribute is not being added to the <style> elements in the rendered HTML output of a web application built using Next.js 14.1.3 and Stencil Core version 4.12.6. Despite attempting to use the setNonce function provided by StencilJS as described in the documentation, the nonce attribute is not reflected in the final rendered HTML.
The nonce attribute should be added to all <style> elements in the rendered HTML output, ensuring compliance with Content Security Policy (CSP) requirements.
System Info
- Browser: Google Chrome, Mozilla Firefox, Safari, Brave
- Technology Stack:
- Next.js version: 14.1.3
- Stencil Core version: 4.12.6
Steps to Reproduce
Implement the setNonce function to dynamically set the nonce attribute on <style> elements.
Verify that the meta tag with the nonce attribute exists in the HTML document.
Ensure that the nonce value is correctly set and available in the runtime environment.
Inspect the rendered HTML output to confirm the presence of the nonce attribute on <style> elements.
Test across different environments, including various browser versions.
Check for any error messages related to CSP violations or nonce handling in the browser console.
Review the documentation and community resources for any known issues or best practices regarding nonce handling.
Thanks for the issue! Do you know if this is a problem without Next.js in the equation? The reproduction feels a bit complicated at the moment, so it would be great if we could strip out some aspects to help isolate the issue!
Prerequisites
Stencil Version
4.12.6
Current Behavior
I encountered an issue where the nonce attribute is not being added to the <style> elements in the rendered HTML output of a web application built using Next.js 14.1.3 and Stencil Core version 4.12.6. Despite attempting to use the
setNonce
function provided by StencilJS as described in the documentation, the nonce attribute is not reflected in the final rendered HTML.Error Message (Observed in Browser):
Expected Behavior
The nonce attribute should be added to all
<style>
elements in the rendered HTML output, ensuring compliance with Content Security Policy (CSP) requirements.System Info
Steps to Reproduce
setNonce
function to dynamically set the nonce attribute on<style>
elements.nonce
attribute exists in the HTML document.Code Reproduction URL
https://github.com/AliKdhim87/configure-csp-nextjs-with-stenciljs
Additional Information
Screenshots:
The text was updated successfully, but these errors were encountered: