-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
Import normalization resolves as out of root if path contains URL encoded characters #2585
Comments
GrygrFlzr
changed the title
Import normalization resolves as out of root if path contains a space
Import normalization resolves as out of root if path contains URL encoded characters
Mar 18, 2021
This is a regression, @GrygrFlzr is already working on a solution for it. |
GrygrFlzr
added a commit
to GrygrFlzr/vite
that referenced
this issue
Mar 20, 2021
GrygrFlzr
added a commit
to GrygrFlzr/vite
that referenced
this issue
Mar 20, 2021
Closed
3 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Describe the bug
Related: #2422 #2435
When the path contains URL encoded characters (e.g. a space, kanji like
東京
), import normalization incorrectly resolves the path as "out of root". Unlike the related issues, this one happens regardless of operating system (tested on Windows, macOS, and Windows WSL2).vite/packages/vite/src/node/plugins/importAnalysis.ts
Lines 185 to 195 in f6ac860
I'm guessing
resolved.id.startsWith(root + '/')
doesn't take the potential url encoding into account.In the verbose logs below, root is
C:/Users/GrygrFlzr/Documents/projects/directory with space
.Reproduction
Open
src/App.svelte
and replace with:Visit http://localhost:3000
System Info
vite
version: 2.1.2Logs
npm run dev -- --debug
The text was updated successfully, but these errors were encountered: