-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Running two vite servers with middleware mode prints websocket error #14328
Copy link
Copy link
Closed
Labels
p2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)
Description
Describe the bug
When running two Vite servers with server.middlewareMode: true, then Vite prints WebSocket server error: Port is already in use to stderr.
Looking at the source code, I don't see a nice way to bypass that with a config. I see that we can define hmr.port, but for our use case (Vitest) hmr is disabled. Even more, we don't need this WS server at all.
Reproduction
https://stackblitz.com/edit/node-enw9th?file=index.mjs,index.html
Steps to reproduce
node index.mjs
System Info
stacbkblitzUsed Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- 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.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p2-nice-to-haveNot breaking anything but nice to have (priority)Not breaking anything but nice to have (priority)
Type
Projects
Status
P2 - 4