VitestUI server not reachable from WSL
Describe the bug
When trying to run VitestUI server from a repo in WSL, although there is no errors in the terminal the server is not reachable when accessing the link.
> vitest --ui
DEV v3.1.4 /home/mlarabi/git/calx/markdown-mailer
UI started at http://localhost:51204/__vitest__/
✓ tests/sun.test.js (1 test) 1ms
✓ adds 1 + 2 to equal 3 1ms
Test Files 1 passed (1)
Tests 1 passed (1)
Start at 08:42:27
Duration 269ms (transform 17ms, setup 0ms, collect 13ms, tests 1ms, environment 0ms, prepare 52ms)
PASS Waiting for file changes...
press h to show help, press q to quit
It works if the repo is in Windows, but from WSL it doesnt. And the additional issue is that if I try to run VitestUI from WSL and then go back to Windows I am not able to start it there either as I get the following error:
> vitest --ui
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Startup Error ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error: listen EACCES: permission denied ::1:51204
at Server.setupListenHandle [as _listen2] (node:net:1917:21)
at listenInCluster (node:net:1996:12)
at GetAddrInfoReqWrap.callback (node:net:2205:7)
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:134:8) {
code: 'EACCES',
errno: -4092,
syscall: 'listen',
address: '::1',
port: 51204
}
ELIFECYCLE Command failed with exit code 1.
Which I assume that the server is still running after WSL attempt.
Reproduction
I tried using this minimal setup:
https://stackblitz.com/~/github.com/mlarabi/vitest-ui-not-working
If I run this on Windows it works. If I run this on WSL it works (no errors) but the server is not reachable from the browser. If I run this again on Windows after the WSL issue it doesnt work anymore.
System Info
Windows:
System:
OS: Windows 11 10.0.26100
CPU: (20) x64 12th Gen Intel(R) Core(TM) i9-12900HK
Memory: 12.38 GB / 31.68 GB
Binaries:
Node: 24.0.2 - C:\nvm4w\nodejs\node.EXE
npm: 11.3.0 - C:\nvm4w\nodejs\npm.CMD
pnpm: 10.11.0 - C:\ProgramData\chocolatey\bin\pnpm.EXE
Browsers:
Edge: Chromium (135.0.3179.66)
Internet Explorer: 11.0.26100.1882
npmPackages:
@vitest/ui: ^3.1.4 => 3.1.4
vitest: ^3.1.4 => 3.1.4
WSL:
System:
OS: Linux 6.6 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
CPU: (20) x64 12th Gen Intel(R) Core(TM) i9-12900HK
Memory: 12.65 GB / 15.46 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 24.0.2 - ~/.nvm/versions/node/v24.0.2/bin/node
npm: 11.3.0 - ~/.nvm/versions/node/v24.0.2/bin/npm
pnpm: 10.11.0 - ~/.local/share/pnpm/pnpm
npmPackages:
@vitest/ui: ^3.1.4 => 3.1.4
vitest: ^3.1.4 => 3.1.4
Used Package Manager
pnpm
Validations
- [x] Follow our Code of Conduct
- [x] Read the Contributing Guidelines.
- [x] Read the docs.
- [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [x] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- [x] The provided reproduction is a minimal reproducible example of the bug.