Link to the code that reproduces this issue
https://github.com/mwskwong/missing-cross-origin-from-preload-script
To Reproduce
- Build the project
- In
index.html, observe the <link> that preloads the ad sense script https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js. Note that crossorigin="anonymous" is missing from <link> despite it is specified in <Script>
Current vs. Expected behavior
Current
When including a script with crossOrigin set:
<Script
async
crossOrigin="anonymous"
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
/>
crossorigin is missing from the <link> that preloads the script.
Expected
For <link>, crossorigin should be set to the same value as that in <Script>.
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Home
Available memory (MB): 32493
Available CPU cores: 20
Binaries:
Node: 20.12.2
npm: N/A
Yarn: N/A
pnpm: 8.14.1
Relevant Packages:
next: 14.3.0-canary.68 // Latest available version is detected (14.3.0-canary.68).
eslint-config-next: 14.3.0-canary.68
react: 19.0.0-beta-04b058868c-20240508
react-dom: 19.0.0-beta-04b058868c-20240508
typescript: 5.4.5
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Script (next/script)
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), Vercel (Deployed)
Additional context
No response
Link to the code that reproduces this issue
https://github.com/mwskwong/missing-cross-origin-from-preload-script
To Reproduce
index.html, observe the<link>that preloads the ad sense scripthttps://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js. Note thatcrossorigin="anonymous"is missing from<link>despite it is specified in<Script>Current vs. Expected behavior
Current
When including a script with
crossOriginset:crossoriginis missing from the<link>that preloads the script.Expected
For
<link>,crossoriginshould be set to the same value as that in<Script>.Provide environment information
Which area(s) are affected? (Select all that apply)
Script (next/script)
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), Vercel (Deployed)
Additional context
No response