fix(turbopack): use posix.join for client URL manifest paths on Windows#90700
Merged
mischnic merged 2 commits intovercel:canaryfrom Mar 2, 2026
Merged
fix(turbopack): use posix.join for client URL manifest paths on Windows#90700mischnic merged 2 commits intovercel:canaryfrom
mischnic merged 2 commits intovercel:canaryfrom
Conversation
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
Collaborator
|
Allow CI Workflow Run
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #90381
On Windows,
path.join()uses backslashes as separators. The manifest paths constructed inTurbopackManifestLoader(buildManifestPath,ssgManifestPath,clientMiddlewareManifestPath) are used both as filesystem paths (combined withthis.distDir) and as client-facing URL segments returned inlowPriorityFiles.When these paths contain backslashes, the client router fetches URLs like:
Fix
Replace
join()withposix.join()(already imported from'path') for the three variables that end up as URL segments:buildManifestPathssgManifestPathclientMiddlewareManifestPathThe
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 devon Windows with Turbopack and checking the Network tab for 404s on manifest files.