You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This assumes a non-empty status from the net use command, which is not always the case. I don't know what causes certain valid mapped drives to not show up with a status, but you can see an example in this article although it's not called out.
Because of this, Vite cannot always correctly resolve paths for valid mapped network drives. Making the status check in the regex optional fixes the issue:
const parseNetUseRE = /^(\w+)? +(\w:) +([^ ]+)\s/
Reproduction
not possible with repo alone
Steps to reproduce
Create a mapped network drive that gives no status when checked with net use. (No idea why this happens or how to do it on purpose.) Attempt to run Vite from that mapped drive.
failed to load config from <network drive>:<repo path>\vite.config.js
error when starting dev server:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '<network drive>:<!!network drive path, repeated!!><repo path>\node_modules\svelte\store\index.mjs' imported from <network drive>:<repo path>\vite.config.js.timestamp-1682168805046-b61e4fd57df9b.mjs
at new NodeError (node:internal/errors:377:5)
at finalizeResolution (node:internal/modules/esm/resolve:405:11)
at moduleResolve (node:internal/modules/esm/resolve:966:10)
at defaultResolve (node:internal/modules/esm/resolve:1174:11)
at ESMLoader.resolve (node:internal/modules/esm/loader:605:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:318:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40) at link (node:internal/modules/esm/module_job:78:36)
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
The Windows network drive check implemented in this PR uses the following regular expression:
vite/packages/vite/src/node/utils.ts
Line 617 in 6321752
This assumes a non-empty status from the
net use
command, which is not always the case. I don't know what causes certain valid mapped drives to not show up with a status, but you can see an example in this article although it's not called out.Because of this, Vite cannot always correctly resolve paths for valid mapped network drives. Making the status check in the regex optional fixes the issue:
const parseNetUseRE = /^(\w+)? +(\w:) +([^ ]+)\s/
Reproduction
not possible with repo alone
Steps to reproduce
Create a mapped network drive that gives no status when checked with
net use
. (No idea why this happens or how to do it on purpose.) Attempt to run Vite from that mapped drive.System Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: