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
While following the "Content Security Policy" documentation, I cloned the linked example repository. However, when running yarn dev, I encountered an error due to the way headers() is called.
The current implementation in the example repository is:
constnonce=headers().get("x-nonce");
However, this leads to an error because headers() is an async function. The correct approach should be:
constnonce=(awaitheaders()).get("x-nonce");
It would be great to have it updated to avoid confusion for other developers.
Is there any context that might help us understand?
The issue is specifically in the file: next.js/examples/with-strict-csp/app/page.js
Does the docs page already exist? Please link to it.
What is the documentation issue?
Hello,
While following the "Content Security Policy" documentation, I cloned the linked example repository. However, when running
yarn dev
, I encountered an error due to the way headers() is called.The current implementation in the example repository is:
However, this leads to an error because headers() is an async function. The correct approach should be:
It would be great to have it updated to avoid confusion for other developers.
Is there any context that might help us understand?
The issue is specifically in the file:
next.js/examples/with-strict-csp/app/page.js
Does the docs page already exist? Please link to it.
https://nextjs.org/docs/app/building-your-application/configuring/content-security-policy
The text was updated successfully, but these errors were encountered: