next/script empty strategy props not working in _document.js #65580
Labels
bug
Issue was opened via the bug report template.
Script (next/script)
Related to Next.js Script Optimization.
Link to the code that reproduces this issue
https://github.com/hwangstar156/nextjs-bug-demo/blob/main/pages/_document.tsx
To Reproduce
next/script with empty strategy props
chrome devtools network tap
next/script with afterInteractive strategy props
chrome devtools network tap
Current vs. Expected behavior
If nextjs' empty strategy prop in _document.js, the script will not be loaded. However, if afterInteractive strategy props are given, it works normally. Since the default setting of empty strategy props is afterInteractive, in this case, one would expect it to operate normally like the previous example, but that is not the case.
Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.6.0: Thu Nov 9 00:38:19 PST 2023; root:xnu-8020.240.18.705.10~1/RELEASE_X86_64 Available memory (MB): 32768 Available CPU cores: 12 Binaries: Node: 18.17.0 npm: 9.6.7 Yarn: 1.22.19 pnpm: 7.22.0 Relevant Packages: next: 14.3.0-canary.53 // Latest available version is detected (14.3.0-canary.53). eslint-config-next: N/A react: 18.3.1 react-dom: 18.3.1 typescript: 5.1.3 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), next start (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: