` ### Current vs. Expected behavior correct: `` ### Provide environment information ```bash Next.js 16.1.6 ``` ### Which area(s) are affected? (Select all that apply) CSS ### Which stage(s) are affected? (Select all that apply) next dev (local) ### Additional context _No response_","inLanguage":"en-US","datePublished":"2026-03-05T04:24:44Z","dateModified":"2026-03-05T04:24:44Z","mainEntityOfPage":{"@type":"WebPage","@id":"https://www.stepcodex.com/en/issue/main-app-css-render-error"},"author":{"@type":"Person","name":"zuojj","url":"https://github.com/zuojj","image":"https://github.com/zuojj"},"publisher":{"@type":"Organization","name":"StepCodex","url":"https://www.stepcodex.com"},"articleSection":"nextjs","about":[{"@type":"Thing","name":"nextjs","url":"https://www.stepcodex.com/en/category/nextjs"}],"contributor":[{"@type":"Person","name":"github-actions[bot]","url":"https://github.com/github-actions%5Bbot%5D","image":"https://github.com/github-actions%5Bbot%5D"}],"keywords":"main-app.css render error, nextjs, how to fix, fix, troubleshooting, root cause, solution, StepCodex","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/LikeAction","userInteractionCount":3}},{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.stepcodex.com/en/issue"},{"@type":"ListItem","position":2,"name":"nextjs","item":"https://www.stepcodex.com/en/category/nextjs"},{"@type":"ListItem","position":3,"name":"main-app.css render error","item":"https://www.stepcodex.com/en/issue/main-app-css-render-error"}]}]

nextjs - 💡(How to fix) Fix main-app.css render error [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#90911Fetched 2026-04-08 00:19:13
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×2closed ×1commented ×1issue_type_added ×1

Code Example

Next.js 16.1.6
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/vercel/next.js/blob/286a73f84a516b06df59c2e5524150c4ad5d47d6/packages/next/src/server/app-render/required-scripts.tsx#L68

To Reproduce

main-app.css is rendered: <script src="_next/static/css/main-app.css" async="" crossorigin=""></script>

Current vs. Expected behavior

correct: <link href="_next/static/css/main-app.css" />

Provide environment information

Next.js 16.1.6

Which area(s) are affected? (Select all that apply)

CSS

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

extent analysis

Fix: Render CSS as <link> instead of <script>

The bug is in required-scripts.tsx – it treats any file that ends with .css as a “script” and emits <script …> tags.
Patch the component (or upgrade to a version where the fix is merged) so that .css files are emitted as <link rel="stylesheet">.

1️⃣ Quick fix – patch the file locally

  1. Create a patch (e.g. using patch-package).
# Install patch‑package if you don’t have it

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix main-app.css render error [1 comments, 2 participants]