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

fsServe checks break on Windows #3359

Closed
2 tasks done
mangowh opened this issue May 11, 2021 · 2 comments
Closed
2 tasks done

fsServe checks break on Windows #3359

mangowh opened this issue May 11, 2021 · 2 comments

Comments

@mangowh
Copy link

mangowh commented May 11, 2021

Describe the bug

The new 2.3.0 fsServe configuration and their relative checks do not work quite well on Windows! In a workspace setup, where the vite app is itself an inner package, path checks fails.

At this line

if (!url.startsWith(serveRoot + path.posix.sep)) {
.startsWith break because posix separators do not match windows separators

I'm gonna try to patch this in a PR, wish me luck

System Info

  System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz 
    Memory: 3.34 GB / 15.78 GB
  Binaries:
    Node: 15.12.0 - C:\Program Files\nodejs\node.EXE      
    Yarn: 1.22.5 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 7.12.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 90.0.4430.93
    Edge: Spartan (44.19041.906.0), Chromium (90.0.818.56)
    Internet Explorer: 11.0.19041.1

Used package manager: npm

Logs

[vite] Internal server error: The request url "C:\MONOREPO_ROOT\node_modules\bootstrap-icons\font\fonts\bootstrap-icons.woff?231ce25e89ab5804f9a6c427b8d325c9" is outside of vite dev server root "C:/MONOREPO_ROOT".
[dev:frontend]       For security concerns, accessing files outside of workspace root is restricted since Vite v2.3.x. 
[dev:frontend]       Refer to docs https://vitejs.dev/config/#server-fsserveroot for configurations and more details.
[dev:frontend]       at ensureServingAccess (C:\MONOREPO_ROOT\node_modules\vite\dist\node\chunks\dep-c9ea388d.js:57841:15)

Before submitting the issue, please make sure you do the following

@mangowh
Copy link
Author

mangowh commented May 11, 2021

Probably fixed by #3350

@mangowh mangowh mentioned this issue May 11, 2021
9 tasks
@mangowh
Copy link
Author

mangowh commented May 11, 2021

Proposed draft fix: #3360

@mangowh mangowh closed this as completed May 11, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant