Nonce attributes are empty when settings CSPs. #81830
-
SummaryHello, Starting from:
The nonce attributes are set to an empty string and not to actual nonce values that I can still access correctly in the header. The behavior is the same using My understanding is that nonce should be set automatically. Here is what i get: ![]() I can access the nonce from server components via the I've tried with all major version since 13 and the result is the same. Any idea on what could be happening ? Also in the doc it is written that we should use dynamic rendering. Does this mean I should add await connection at the root layout ? Thanks Additional informationNo response Exampleyarn create next-app --example with-strict-csp with-strict-csp-app csp-tests |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
nonce="" --> Add export const dynamic = 'force-dynamic' |
Beta Was this translation helpful? Give feedback.
-
Hi, I think the empty string behavior you describe is because of spec compliance, and it is done by the browser:
This is why you can see it server side, but it gives the apparent behavior of not being present client side. You can use |
Beta Was this translation helpful? Give feedback.
Hi,
I think the empty string behavior you describe is because of spec compliance, and it is done by the browser:
This is why you can see it ser…