Skip to content

fix: preserve Windows namespace paths (fix #23986) - #23989

Open
sep2 wants to merge 1 commit into
vitejs:mainfrom
sep2:fix/normalize-windows-namespaces
Open

sep2 wants to merge 1 commit into
vitejs:mainfrom
sep2:fix/normalize-windows-namespaces

Conversation

@sep2

@sep2 sep2 commented Nov 4, 2026

Copy link
Copy Markdown

Fixes #23986.

Use path.win32.normalize() for paths beginning with //, then convert the result to forward slashes. This preserves Windows device and UNC roots, including node:vfs mount points. Other paths keep the existing POSIX normalization.

Regression tests cover device/UNC paths, relative segments, trailing separators, idempotence, native Windows separators, POSIX filenames, and reading a mounted node:vfs file through its normalized path.

Validation

  • pnpm build
  • pnpm --filter vite typecheck
  • Full unit suite on macOS with Node 24.19.0, 26.5.0, and 26.13.0
  • Windows Node 26.13.0 verification: the upstream implementation reproduces the VFS ENOENT; the fixed implementation passes all 1,124 unit tests
  • Oxfmt and Oxlint checks on both changed files

AI assistance

A coding agent prepared the implementation and tests and ran the checks above. The approach delegates namespace handling to Node rather than reconstructing path prefixes manually; the before/after Windows run verifies that normalized paths still address the same mounted memory files.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

normalizePath removes the Windows device namespace prefix

1 participant