-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(vite-node): remove suffix slash on file protocol for window #6109
Conversation
I don't think this is the root of the problem, this code wasn't touched for a long time. We need to know why the issue happens when it happens. It worked in 1.6.0. We also need a new test case of course. |
I have trouble to add test. b6a34fa And let's look for the reason why it worked in 1.6.0. The information I checked while debugging was generated from 2.0.0-beta.1, but the changes in 2.0.0-beta.1 did not seem to have much effect. I checked variously, such as node version and vite, but the only thing I found was the corresponding PR. |
|
Thanks for guide. I remove unit test and add integration test about write file and dynamic import. |
I think failed test is not depend on this pr changes. So new added test is works as well and I'll keep looking for reasons. |
I found it @sheremet-va. this happen is because of #5177. |
So I think this change can be resolved separately from the cause, so why not reflect it? Basically, the path with the suffix slash in window is wrong. |
LGTM! |
Description
In window platform, dynamic import with file protocol are convert to request id and request id normalized by normalizeRequestId function.
normalizeRequestId function's return value with file protocol is like '/C:Users/user/workspace/file.js' in window, so fs can't resolve this absolute path because of suffix forward slash.
For that reason, when isWindow is true, i decided to remove the suffix slash.
before this pr
after this pr
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.Fix: #6087