Open mwskwong opened 2 weeks ago
https://github.com/mwskwong/missing-cross-origin-from-preload-script
index.html
<link>
https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
crossorigin="anonymous"
<Script>
When including a script with crossOrigin set:
crossOrigin
<Script async crossOrigin="anonymous" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" />
crossorigin is missing from the <link> that preloads the script.
crossorigin
For <link>, crossorigin should be set to the same value as that in <Script>.
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
Script (next/script)
next dev (local), next build (local), Vercel (Deployed)
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
crossOrigin
set: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
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