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
TLDR, outDir was bla-bla/Bin, but vite built it into bla-bla/bin because it already existed, and then tried to to serve bla-bla/Bin for preview which failed.
As you can see, it has Bin folder in the path, with capital B.
Now if I already have a bin folder (lowercase b) - vite will build into it instead of creating Bin folder, and later fail to use that folder during vite preview due to CachedFsUtils.
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.
Testing v6.0.2, I can confirm that one of the issues is resolved - there will be no 404 after taking reproduction steps.
However, it will still build into lowercase bin folder if it already exists instead of deleting it and creating uppercase Bin folder as per config. This could be just a Windows/NTFS thing tho, maybe not much that can/should be done on vite side, up to you to decide.
Describe the bug
TLDR,
outDir
wasbla-bla/Bin
, but vite built it intobla-bla/bin
because it already existed, and then tried to to servebla-bla/Bin
forpreview
which failed.I've had the following
vite.config.ts
:As you can see, it has
Bin
folder in the path, with capitalB
.Now if I already have a
bin
folder (lowercaseb
) - vite will build into it instead of creatingBin
folder, and later fail to use that folder duringvite preview
due toCachedFsUtils
.With the following change in https://github.com/vitejs/vite/blob/main/packages/vite/src/node/fsUtils.ts#L63, all works fine:
Reproduction
https://github.com/Maxim-Mazurok/vite-cache-fs-repro
Steps to reproduce
npm ci
npm run build
- should build into existingbin
folder (included in repo) instead ofBin
npm run preview
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: