next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Next.js 13: How to pass nonce as prop so that initial scripts receive it?

Open tmb-github opened this issue 3 years ago • 0 comments

Describe the feature you'd like to request

In Next.js 12, we simply add a nonce attribute to <Head> and <NextScript> (from "next/document") in _document.js in order for nonces to be written to the initial scripts that Next.js creates. In Next.js 13, adding those elements from next/document has been eliminated in the new app paradigm, and Next seemingly does it in the background.

Please clarify where we pass a nonce as a prop so that Next 13 adds the nonce to the initial scripts.

Describe the solution you'd like

Clarification on the above matter.

Describe alternatives you've considered

I cannot see how it can be done provided the current design pattern.

tmb-github avatar Nov 02 '22 03:11 tmb-github