fix(cli): use pathToFileURL for dynamic imports in oxfmt/oxlint bin wrappers#867
Merged
fix(cli): use pathToFileURL for dynamic imports in oxfmt/oxlint bin wrappers#867
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
e82a828 to
313d94d
Compare
leaysgur
approved these changes
Mar 14, 2026
Contributor
leaysgur
left a comment
There was a problem hiding this comment.
Thank you~!
Seeing snap, we may need wrapper restrictions to be more strict? (Allow only single —-lsp)
Member
Author
I intentionally added an extra |
…rappers On Windows, Node.js ESM loader rejects absolute paths like `c:\Users\...` because it interprets the drive letter as a URL scheme. Convert resolved paths to file:// URLs via pathToFileURL() which works on all platforms. Also enable win32 snap tests for both wrappers since the non-LSP error path doesn't involve dynamic imports. Closes oxc-project/oxc-vscode#149
Invoke bin scripts via `node` with relative path instead of relying on PATH resolution, which fails on Windows because extensionless files are invisible to PATHEXT-based command lookup. Add `--lsp --help` test cases to exercise the dynamic import code path (the pathToFileURL fix) in both wrappers.
313d94d to
0b713b8
Compare
Member
Author
May I ask if this merger has solved the problem? ➜ vp env current
VITE+ - The Unified Toolchain for the Web
Environment:
Version 25.8.0
Source default
Source Path C:\Users\bddxg\.vite-plus\config.json
Tool Paths:
node C:\Users\bddxg\.vite-plus\js_runtime\node\25.8.0\node.exe
npm C:\Users\bddxg\.vite-plus\js_runtime\node\25.8.0\npm.cmd
npx C:\Users\bddxg\.vite-plus\js_runtime\node\25.8.0\npx.cmd
➜ vp --version
VITE+ - The Unified Toolchain for the Web
vp v0.1.11
Local vite-plus:
vite-plus v0.1.11
Tools:
vite v8.0.0
rolldown v1.0.0-rc.9
vitest v4.1.0
oxfmt v0.40.0
oxlint v1.55.0
oxlint-tsgolint v0.16.0
tsdown v0.21.2 |
Member
Author
|
@bd-dxg should update vite-plus to 0.1.12 |
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.


On Windows, Node.js ESM loader rejects absolute paths like
c:\Users\...because it interprets the drive letter as a URL scheme. Convert resolved
paths to file:// URLs via pathToFileURL() which works on all platforms.
Also enable win32 snap tests for both wrappers since the non-LSP error
path doesn't involve dynamic imports.
Closes #865