nextjs - 💡(How to fix) Fix Turbopack: empty middleware-manifest for proxy.ts on Next 16.2.4 (Windows; both root and src/ placement) [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#93320Fetched 2026-04-29 06:10:45
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
closed ×1commented ×1labeled ×1locked ×1

Fix Action

Workaround

Keep the file at the project root as middleware.ts (export middleware). Deploys to Vercel work correctly with this layout but emit a deprecation-style log expecting proxy.ts.

Code Example

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
Binaries:
  Node: 25.9.0
  npm: 11.12.1
Relevant Packages:
  next: 16.2.4
  react: 19.2.5
  react-dom: 19.2.5
  typescript: 6.0.2
Next.js Config:
  output: N/A

---

{
  "version": 3,
  "middleware": {},
  "sortedMiddleware": [],
  "functions": {}
}
RAW_BUFFERClick to expand / collapse

Verify canary release

I verified the bug exists in the latest stable (16.2.4). Have not yet retested on canary 16.3.0-canary.3.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
Binaries:
  Node: 25.9.0
  npm: 11.12.1
Relevant Packages:
  next: 16.2.4
  react: 19.2.5
  react-dom: 19.2.5
  typescript: 6.0.2
Next.js Config:
  output: N/A

Which area(s) are affected?

Middleware, Turbopack

Which stage(s) are affected?

next build (local), next start (local), production deploy on Vercel

Current vs. expected behavior

When the project's middleware/proxy file is named proxy.ts (the Next 16 convention) at either the project root or inside src/, next build produces an empty middleware manifest:

{
  "version": 3,
  "middleware": {},
  "sortedMiddleware": [],
  "functions": {}
}

The build summary still prints ƒ Proxy (Middleware), so Next sees the file — but Turbopack's Rust-side manifest writer never registers it. At runtime the proxy is silently skipped: no matcher rules fire, no auth redirects, no request rewrites.

Renaming the file to middleware.ts at the project root (with export async function middleware) immediately produces a populated manifest with the matcher entry, and proxy logic runs correctly in both next build && next start and production Vercel deploys.

Reproduction

  1. Fresh Next 16.2.4 project on Windows 11 with src/ directory.
  2. Create proxy.ts (or src/proxy.ts) with a default proxy export and a non-trivial matcher config.
  3. npm run build.
  4. Inspect .next/server/middleware-manifest.json"middleware": {} and "sortedMiddleware": [].
  5. Rename the file to root middleware.ts and rename the export to middleware. Rebuild — manifest now contains the entry under /.

Prior art

  • Same symptom as #85243, which was closed citing fix in #85443 and is now locked. The github-actions bot in that thread instructs new reporters to open a fresh issue.
  • Comments on #85243 suggest src/proxy.ts resolves it for some users — we tested both placements on 16.2.4 and both produce empty manifests on Windows 11 + Turbopack.

Workaround

Keep the file at the project root as middleware.ts (export middleware). Deploys to Vercel work correctly with this layout but emit a deprecation-style log expecting proxy.ts.

extent analysis

TL;DR

Rename the middleware file to middleware.ts at the project root and export the function as middleware to workaround the issue.

Guidance

  • Verify that the issue is specific to the proxy.ts file name and location by testing with middleware.ts at the project root.
  • Check the .next/server/middleware-manifest.json file to confirm whether the middleware is being registered correctly.
  • If using middleware.ts at the project root resolves the issue, but emits a deprecation log, consider monitoring for updates to Next.js that may address this behavior.
  • Test the workaround on different environments, including local and production deployments, to ensure consistency.

Notes

The issue seems to be specific to Windows 11 and Turbopack, and may be related to the file naming convention used in Next 16. The provided workaround may not be the final solution, but it allows for correct functionality in the meantime.

Recommendation

Apply the workaround by renaming the file to middleware.ts and exporting the function as middleware, as this allows for correct functionality despite emitting a deprecation log.

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 Turbopack: empty middleware-manifest for proxy.ts on Next 16.2.4 (Windows; both root and src/ placement) [1 comments, 2 participants]