Describe the bug
Reproduction repository
A minimal reproduction is available here:
https://github.com/tanmay-haldar0/vite-path-tilde-repro
To reproduce:
- Clone the repository.
- Place it in a directory containing
~, for example:
D:\code\test~\vite-path-tilde-repro
- Run:
- Open the local Vite URL.
Reproduction
https://github.com/tanmay-haldar0/vite-path-tilde-repro
Steps to reproduce
- Create a new Vite project.
npm create vite@latest vite-app
cd vite-app
npm install
- Move the project into a Windows directory whose path contains the
~ character.
Example:
- Start the development server.
-
Open the local development URL shown by Vite (for example, http://localhost:5173/).
-
Observe that Vite responds with:
403 Restricted
The request url ".../index.html" is outside of Vite serving allow list.
- Move the same project to a path without
~.
Example:
- Run:
- Open the same URL again. The application loads normally.
System Info
System:
OS: Windows 11 10.0.26200
CPU: (12) x64 AMD Ryzen 5 5500GT with Radeon Graphics
Memory: 2.46 GB / 7.37 GB
Binaries:
Node: 24.18.0 - C:\Program Files\nodejs\node.EXE
npm: 11.16.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 150.0.7871.47
Edge: Chromium (150.0.4078.48)
Used Package Manager
npm
Logs
Click to expand!
PS D:\code\test~\vite-path-tilde-repro> npx vite --debug
vite:config bundled config file loaded in XXms
vite:env loading env files:
vite:env D:/code/test~/vite-path-tilde-repro/.env
vite:env D:/code/test~/vite-path-tilde-repro/.env.local
vite:env D:/code/test~/vite-path-tilde-repro/.env.development
vite:env D:/code/test~/vite-path-tilde-repro/.env.development.local
vite:env env files loaded in Xms
vite:config using resolved config:
{
...
root: 'D:/code/test~/vite-path-tilde-repro',
...
server: {
fs: {
strict: true,
allow: [
'D:/code/test~/vite-path-tilde-repro'
]
}
}
...
}
VITE v8.1.3 ready in XXX ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
The request url "D:/code/test~/vite-path-tilde-repro/index.html" is outside of Vite serving allow list.
- D:/code/test~/vite-path-tilde-repro
Refer to docs https://vite.dev/config/server-options.html#server-fs-allow for configurations and more details.
Validations
Describe the bug
Reproduction repository
A minimal reproduction is available here:
https://github.com/tanmay-haldar0/vite-path-tilde-repro
To reproduce:
~, for example:Reproduction
https://github.com/tanmay-haldar0/vite-path-tilde-repro
Steps to reproduce
npm create vite@latest vite-app cd vite-app npm install~character.Example:
Open the local development URL shown by Vite (for example,
http://localhost:5173/).Observe that Vite responds with:
~.Example:
System Info
System: OS: Windows 11 10.0.26200 CPU: (12) x64 AMD Ryzen 5 5500GT with Radeon Graphics Memory: 2.46 GB / 7.37 GB Binaries: Node: 24.18.0 - C:\Program Files\nodejs\node.EXE npm: 11.16.0 - C:\Program Files\nodejs\npm.CMD Browsers: Chrome: 150.0.7871.47 Edge: Chromium (150.0.4078.48)Used Package Manager
npm
Logs
Click to expand!
Validations