nextjs - ✅(Solved) Fix Docs: Tailwind styles not loading when Next.js middleware blocks _next/static routes [1 pull requests, 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#92435Fetched 2026-04-08 02:59:58
View on GitHub
Comments
1
Participants
2
Timeline
9
Reactions
0
Author
Participants
Assignees
Timeline (top)
referenced ×4assigned ×1closed ×1commented ×1

Root Cause

The root cause was that middleware was intercepting requests to /_next/static and redirecting them due to the auth logic, which prevented ccss/js chunks from loading.

Fix Action

Fixed

PR fix notes

PR #92441: docs: clarify that proxy/middleware matches static assets by default

Description (problem / solution / changelog)

<!-- CURSOR_AGENT_PR_BODY_BEGIN -->

What?

Adds an explicit note about Proxy's default matching behavior at the top of the Matcher section in the Proxy API reference — the first place users look when configuring which paths Proxy runs on.

Why?

Users have reported issues where Tailwind styles and other static assets fail to load because their Proxy auth logic intercepts _next/static requests and redirects them (see #92435). The existing docs mention that Proxy runs on "every route" but don't explicitly call out static assets, image optimizations, or public folder files — making this a common pitfall that gets misdiagnosed as a CSS/PostCSS problem.

How?

Added an inline paragraph at the top of the Matcher subsection explaining that without a matcher, Proxy matches every request — including _next/static, _next/image, and public/ files — and that this can break asset loading. Links to the existing Negative matching section.

Fixes #92435

<!-- NEXT_JS_LLM_PR --> <!-- CURSOR_AGENT_PR_BODY_END -->

Slack Thread

<div><a href="https://cursor.com/agents/bc-263e5d8f-e356-5e3a-a247-856d00a78af4"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-263e5d8f-e356-5e3a-a247-856d00a78af4"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div>

Changed files

  • docs/01-app/03-api-reference/03-file-conventions/proxy.mdx (modified, +5/-1)
RAW_BUFFERClick to expand / collapse

What is the documentation issue?

I ran into an issue where Tailwind styles were not applied at all in a Next.js app using middleware (proxy.ts)

Is there any context that might help us understand?

The root cause was that middleware was intercepting requests to /_next/static and redirecting them due to the auth logic, which prevented ccss/js chunks from loading.

Suggestion: It might help to explicitly mention in the docs that middleware should exclude: -/_next -/api -static assets

Otherwise, users may misdiagnose this as a tailwind or PostCSS issue

Does the docs page already exist? Please link to it.

No response

extent analysis

TL;DR

Exclude Next.js specific routes and static assets from middleware to prevent interference with Tailwind styles and other static resources.

Guidance

  • Identify and review the middleware configuration in proxy.ts to ensure it does not intercept requests to / _next/static` and other critical Next.js routes.
  • Update the middleware logic to explicitly exclude routes such as /_next, /api, and static assets to prevent redirection and allow proper loading of CSS/JS chunks.
  • Verify that Tailwind styles are applied correctly after updating the middleware configuration by checking the application's frontend.
  • Consider adding documentation or comments in the code to highlight the importance of excluding specific routes from middleware to avoid similar issues in the future.

Example

No specific code example is provided due to the lack of detailed code context in the issue, but the fix involves modifying the proxy.ts file to exclude specific routes from middleware interception.

Notes

This solution assumes that the issue is solely due to the middleware intercepting critical Next.js routes. If the problem persists after applying this fix, further investigation into the application's configuration and setup may be necessary.

Recommendation

Apply workaround: Update the middleware configuration to exclude Next.js specific routes and static assets, as this directly addresses the identified root cause of the issue.

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 - ✅(Solved) Fix Docs: Tailwind styles not loading when Next.js middleware blocks _next/static routes [1 pull requests, 1 comments, 2 participants]