Files
next.js/test/e2e/app-dir/app/pages/pages-script-manual-nonce.js
ba73ff3cba Ensure manual nonce on Script works as expected (#78939)
While investigating https://github.com/vercel/next.js/pull/78936 we
noticed that manually setting `nonce` prop on `next/script` tag it
wasn't honored properly. This ensures we fully propagate it when
manually set as a prop.

---------

Co-authored-by: Zack Tanner <[email protected]>
2025-05-07 20:44:20 -07:00

19 lines
482 B
JavaScript

import Script from 'next/script'
import { ShowScriptOrder } from '../app/script-nonce/show-order'
export default function Page() {
return (
<>
<p>script-nonce</p>
<Script strategy="afterInteractive" src="/test1.js" nonce="hello-world" />
<Script
strategy="beforeInteractive"
src="/test2.js"
nonce="hello-world"
/>
<Script strategy="beforeInteractive" id="3" nonce="hello-world" />
<ShowScriptOrder />
</>
)
}