Error when server restart within middleware mode #12707
Labels
p3-minor-bug
An edge case that only affects very specific usage (priority)
regression
The issue only appears after a new release
Describe the bug
I'm using the middleware mode of Vite, and upon updating vite.config.js, the development server commenced restarting. After it launch, the browser console began throwing errors,
while in Vite's logs there was also a message of the port being occupied.
When I switched to vite@4.1.4, this issue was not present.
the port error is raise on packages/vite/src/node/server/index.ts:840
when the server.close() called.
related PR: #12379
Reproduction
https://github.com/rainbowatcher/vite-middleware-mode-error-eproduction.git
Steps to reproduce
git clone https://github.com/rainbowatcher/vite-middleware-mode-error-eproduction.git
pnpm i
node src/server/server.js
vite.config.js
and save, then wait the dev server restart.System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: