Skip to content

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

@tmb-github

Description

@tmb-github

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions