Skip to content
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: dev server resolve plugin for win32 #1317

Merged
merged 3 commits into from Jan 4, 2021
Merged

fix: dev server resolve plugin for win32 #1317

merged 3 commits into from Jan 4, 2021

Conversation

patak-dev
Copy link
Member

Fixed a slash check in plugins/resolve.ts resolved() that was causing the dev server to fail for paths in windows.

@yyx990803
Copy link
Member

I don't think this is the right fix. The double slash was intentional. Will need a proper repro for windows.

@patak-dev
Copy link
Member Author

FWIW, in my win machine, fsPaths at that point were like /C:/.../dist/client/app/index.js.
Let me know if there is a way I could provide more information.

@yyx990803
Copy link
Member

Oh I think I know now, this is in VitePress where it directly feeds a non-normalized fs path after /@fs/.

I think we should handle that in Vite core though. So the proper fix here should be something that can handle all the following cases:

  • /@fs/C:\foo\bar -> /foo/bar
  • /@fs/foo/bar -> /foo/bar
  • /@fs//foo/bar -> /foo/bar

@patak-dev
Copy link
Member Author

Got it. I moved this logic to a helper in utils so it could be tested independently later

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.

None yet

2 participants