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 is a very niche issue that affects Vitest and anyone using the ModuleRunner alongside native imports.
This issue appears only when running Vite in CMD.EXE and only if process.cwd() has a lowercase drive letter (c:/ instead of C:/).
The incorrect values are present in every path returned from the this.resolve also uses a different drive letter casing (note: rollup returns the same case as in process.cwd())
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
This is a very niche issue that affects Vitest and anyone using the
ModuleRunner
alongside native imports.This issue appears only when running Vite in
CMD.EXE
and only ifprocess.cwd()
has a lowercase drive letter (c:/
instead ofC:/
).The incorrect values are present in every path returned from the
this.resolve
also uses a different drive letter casing (note: rollup returns the same case as inprocess.cwd()
)Reproduction
https://stackblitz.com/edit/node-86cw3m?file=vite.config.js,index.js,basic.js,test.js,package-lock.json
Steps to reproduce
All imports are transformed with
/@fs/
prefix instead of being relative to the localhost. (and they also use the wrong casing)The value returned from the
server.pluginContainer.resolveId
also changes the casing.The casing is kept as is only if
resolve.preserveSymlink
is enabled. This is because the normalization happens during therealpathSync
call:vite/packages/vite/src/node/fsUtils.ts
Line 423 in 0ab20a3
vite/packages/vite/src/node/utils.ts
Line 654 in 0ab20a3
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: