Skip to content

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

Merged
mischnic merged 2 commits intovercel:canaryfrom
sleitor:fix-90381
Mar 2, 2026
Merged

fix(turbopack): use posix.join for client URL manifest paths on Windows#90700
mischnic merged 2 commits intovercel:canaryfrom
sleitor:fix-90381

Conversation

@sleitor
Copy link
Contributor

@sleitor sleitor commented Feb 28, 2026

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.

On Windows, path.join() uses backslashes as separators, which causes
manifest file URLs like _buildManifest.js, _ssgManifest.js, and
_clientMiddlewareManifest.js to contain backslashes. These then get
URL-encoded as %5C, resulting in 404 errors since the HTTP server
serves paths with forward slashes only.

Fix by using path.posix.join() (already imported) for the three path
variables that are returned as client-facing URL segments:
- buildManifestPath
- ssgManifestPath
- clientMiddlewareManifestPath

The path.join() calls that combine these with this.distDir for
filesystem operations are left unchanged, as path.join() correctly
handles mixed-separator paths on all platforms.

Fixes vercel#90381
@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Feb 28, 2026

Allow CI Workflow Run

  • approve CI run for commit: e4c5972

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Copy link
Member

@mischnic mischnic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mischnic mischnic merged commit b645f4c into vercel:canary Mar 2, 2026
147 checks passed
@sleitor sleitor deleted the fix-90381 branch March 2, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manifest Files 404 Not Found (_clientMiddlewareManifest.js, _buildManifest.js, _ssgManifest.js) on Windows with Turbopack

3 participants