Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
next/script not set script tag on next export | GoodFirstPicks

next/script not set script tag on next export

vercel/next.js 5 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

The issue involves missing script tags in exported HTML, requiring investigation into Next.js's export behavior.

AI Summary

The issue reports that inline `next/script` tags are missing from statically exported HTML files when using `next export`. The problem persists across versions, including Next.js 16.1.6 with Turbopack. The task involves understanding why script tags are omitted during export and ensuring they are correctly included in the output.

Issue Description

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

next 13 node 16

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

I have a script that has a public location and I upload it like this

<Script id="lime">
        {`document.body.style.backgroundColor = 'lime'`}
      </Script>
image

after next build && next export when I look at the builded html, there is no link to the script

Expected Behavior

script tag in index.html

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

https://stackblitz.com/edit/vercel-next-js-2ncgth

To Reproduce

  1. yarn build
  2. open out dir
  3. open index.html
  4. nothing about script in file

GitHub Labels

bug

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 10 points when you complete it!

Risk Flags

  • stale issue
  • potential architectural complexity
Loading labels...

Details

Points10 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno