-
-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to pass nonce
to ThemeProvider
in _app.tsx
?
#218
Comments
Additional info: As a workaround, I put hash of all the scripts inside the |
Everything works with 0.3.0, but the error still persists in console. Maybe it's related to this comment vercel/next.js#54907 (reply in thread). @pacocoursey NextJs Script implementation also doesn't apply nonce on client, due to this comment https://github.com/vercel/next.js/blob/v14.2.0-canary.48/packages/next/src/client/script.tsx#L228. Related facebook/react#26028 |
Due to Next.js's regular csp setting, we are generating
nonce
in_document.tsx
and need to pass it to_app.tsx
Below code is just example I am using tho doesn't work, getting two of errors:
Warning: Extra attributes from the server: nonce script
when passing nonce throughnonce
toApp
likenonce={nonce}
Warning: Prop 'nonce' did not match. Server: "" Client: "sOmEtHiNgHaShGeNeRaTeD=="
when passing nonce throughpageProps.nonce
The text was updated successfully, but these errors were encountered: