Repository navigation
fix(module): end drive root candidates with a separator to stop a VFS panic - #1007
Merged
camc314 merged 5 commits intoNov 20, 2026
Merged
Conversation
âĶ panic Port Go `ensureRootedPathRootSeparator` (`rooted_path.go:65`) into `resolve_path_for_module` and `normalize_path_for_cjs_resolution`. Go builds these candidates with `RootedDirectoryPath.ResolveFile` and `ResolveDirectory` (`rooted_path.go:727`), which end a path that is only a root with a separator. `normalize_path` keeps `C:`, as Go `NormalizePath` does, so it stays unchanged. A type reference or a relative import whose name is only a drive root, such as `C:`, gave the candidate `C:`. The file probe `C:.d.ts` is not an absolute path, so the VFS panicked when the drive existed. Without the drive, `tsrs -p` did not panic, but its resolution trace printed `'C:'` where tsgo prints `'C:/'`.
Contributor
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
magurotuna
marked this pull request as ready for review
November 17, 2026 08:24
camc314
approved these changes
Nov 18, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 18, 2026
camc314
enabled auto-merge
November 18, 2026 13:27
âĶoot-candidate # Conflicts: # docs/COMPATIBILITY.md
oxc-project#1009 added `resolution_candidate_from_directory_path` for the type root lookups. It did not use `resolve_path_for_module`, so the type root candidate for the name `C:` was `C:` again, and the file probe `C:.d.ts` panicked (`resolver_drive_root_test`). Go `ResolveFile` and `ResolveDirectory` keep the root separator, so add it there too. AI assistance: written with Claude Code.
camc314
approved these changes
Nov 20, 2026
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.
A type reference or a relative import whose name is only a drive root panicked:
The resolver built the candidate
C:and probedC:.d.ts. That is not an absolute path, so the VFS panicked withvfs: path "C:.d.ts" is not absolute. The panic needs the drive to exist (I reproduced it with an in-memory file system). Without the drive,tsrs -p --traceResolutionprinted'C:'where tsgo prints'C:/'.Go adds the root separator when it builds the candidate (
ensureRootedPathRootSeparator).resolve_path_for_module,normalize_path_for_cjs_resolution, andresolution_candidate_from_directory_path(the type root candidates from #1009) now do the same, with the existing port of that function.Tests:
resolver_drive_root_test(expected traces from the pinned Go resolver) and thetype-reference-drive-rootregression.AI assistance: written with Claude Code.