nextjs - ✅(Solved) Fix Manifest Files 404 Not Found (`_clientMiddlewareManifest.js`, `_buildManifest.js`, `_ssgManifest.js`) on Windows with Turbopack [1 pull requests, 2 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#90381Fetched 2026-04-08 00:20:18
View on GitHub
Comments
2
Participants
2
Timeline
9
Reactions
0
Timeline (top)
commented ×2labeled ×2closed ×1cross-referenced ×1

Fix Action

Fixed

PR fix notes

PR #90700: fix(turbopack): use posix.join for client URL manifest paths on Windows

Description (problem / solution / changelog)

Summary

Fixes #90381

On Windows, path.join() uses backslashes as separators. The manifest paths constructed in TurbopackManifestLoader (buildManifestPath, ssgManifestPath, clientMiddlewareManifestPath) are used both as filesystem paths (combined with this.distDir) and as client-facing URL segments returned in lowPriorityFiles.

When these paths contain backslashes, the client router fetches URLs like:

/_next/static%5Cdevelopment%5C_buildManifest.js      ← 404
/_next/static%5Cdevelopment%5C_ssgManifest.js        ← 404
/_next/static%5Cdevelopment%5C_clientMiddlewareManifest.js  ← 404

Fix

Replace join() with posix.join() (already imported from 'path') for the three variables that end up as URL segments:

  • buildManifestPath
  • ssgManifestPath
  • clientMiddlewareManifestPath

The join(this.distDir, ...) calls used for filesystem writes are left unchanged — path.join() handles mixed-separator paths correctly on all platforms.

Testing

Reproduce by running next dev on Windows with Turbopack and checking the Network tab for 404s on manifest files.

Changed files

  • packages/next/src/shared/lib/turbopack/manifest-loader.ts (modified, +3/-3)

Code Example

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Education
  Available memory (MB): 16237
  Available CPU cores: 12
Binaries:
  Node: 25.2.1
  npm: 11.6.2
  Yarn: N/A
  pnpm: 10.29.3
Relevant Packages:
  next: 16.2.0-canary.58 // Latest available version is detected (16.2.0-canary.58).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A

---

buildManifestPath = join(CLIENT_STATIC_FILES_PATH, this.buildId, '_buildManifest.js');
ssgManifestPath = join(CLIENT_STATIC_FILES_PATH, this.buildId, '_ssgManifest.js');

---

let clientMiddlewareManifestPath = this.deploymentId && !this.dev 
  ? join(CLIENT_STATIC_FILES_PATH, TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST) 
  : join(CLIENT_STATIC_FILES_PATH, this.buildId, TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST);
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://github.com/rubenferreira97/next-manifest-issue

To Reproduce

  1. Clone the repository (next template without changes) and install dependencies with canary.
  2. Start the application in development mode with Turbopack (e.g., next dev).
  3. Open the application in your browser.
  4. Open the developer tools and check the Network tab or the Console.
  5. Observe the 404 errors for the following manifest files:
    • /_next/static%5Cdevelopment%5C_clientMiddlewareManifest.js
    • /_next/static%5Cdevelopment%5C_buildManifest.js
    • /_next/static%5Cdevelopment%5C_ssgManifest.js

Current vs. Expected behavior

Current behavior: When running Next.js Canary with Turbopack on Windows, there are 404 errors for the manifest files. The dynamically generated URL paths passed to the client contain URL-encoded backslashes (%5C) instead of forward slashes (/). If the %5C are manually replaced with / in the URL, the files are successfully found.

Expected behavior: Client-facing URLs should always use forward slashes (/) regardless of the host operating system. The manifest files should load successfully without 404 errors.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Education
  Available memory (MB): 16237
  Available CPU cores: 12
Binaries:
  Node: 25.2.1
  npm: 11.6.2
  Yarn: N/A
  pnpm: 10.29.3
Relevant Packages:
  next: 16.2.0-canary.58 // Latest available version is detected (16.2.0-canary.58).
  eslint-config-next: N/A
  react: 19.2.3
  react-dom: 19.2.3
  typescript: 5.9.3
Next.js Config:
  output: N/A

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

Turbopack

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

next dev (local), next build (local), next start (local)

Additional context

The bug stems from packages/next/src/shared/lib/turbopack/manifest-loader.ts.

When constructing the paths for buildManifestPath, ssgManifestPath, and clientMiddlewareManifestPath, the file uses Node's native path.join(). On Windows, path.join() inherently uses \ as the path separator.

These dynamically generated paths are subsequently included in the payload passed to the client (for example via lowPriorityFiles), causing the Next.js client router to fetch the URLs using literal backslashes, which then get URL-encoded into %5C.

Relevant code snippets in manifest-loader.ts: In writeClientBuildManifest():

buildManifestPath = join(CLIENT_STATIC_FILES_PATH, this.buildId, '_buildManifest.js');
ssgManifestPath = join(CLIENT_STATIC_FILES_PATH, this.buildId, '_ssgManifest.js');

In writeMiddlewareManifest():

let clientMiddlewareManifestPath = this.deploymentId && !this.dev 
  ? join(CLIENT_STATIC_FILES_PATH, TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST) 
  : join(CLIENT_STATIC_FILES_PATH, this.buildId, TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST);

extent analysis

Fix: Force POSIX‑style URLs for Turbopack manifests on Windows

The 404s are caused by path.join() returning Windows‑style paths (\). Those strings are sent to the browser, get URL‑encoded as %5C, and the client can’t resolve them. Replace the Windows‑specific join with a POSIX‑style join (or normalise the result) before the path is serialized to the client.

1. Change manifest-loader.ts

// packages/next/src/shared/lib/turbopack/manifest-loader.ts
import path from 'node:path';

// Helper – always returns forward‑slash paths
function posixJoin(...segments: string[]) {
  // path.posix.join always uses '/' regardless of OS
  return path.posix.join(...segments);
}

// ------------------------------------------------------------------
// writeClientBuildManifest()
buildManifestPath = posixJoin(
  CLIENT_STATIC_FILES_PATH,
  this.buildId,
  '_buildManifest.js'
);
ssgManifestPath = posixJoin(
  CLIENT_STATIC_FILES_PATH,
  this.buildId,
  '_ssgManifest.js'
);

// ------------------------------------------------------------------
// writeMiddlewareManifest()
let clientMiddlewareManifestPath = this.deploymentId && !this.dev
  ? posixJoin(C

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 Manifest Files 404 Not Found (`_clientMiddlewareManifest.js`, `_buildManifest.js`, `_ssgManifest.js`) on Windows with Turbopack [1 pull requests, 2 comments, 2 participants]