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
server in the user config option called middlewareMode and server in the hmr options are typed as http.Server. But because the httpServer belonging to the ViteDevServer is typed as something less restrictive, ViteDevServer's own httpServer cannot be used as server in the middlewareMode or hmr options for another vite config. This seems unnecessary, especially since doing so anyway (despite TypeScript's protests) still results in a working config.
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.
found my way here while trying to disable hmr entirely1 b/c whenever i stop the local server, my app sits there polling [vite] server connection lost. Polling for restart... which yields a whole pile of net::ERR_CONNECTION_REFUSED that eventually renders my browser unresponsive 💀👎
i'm currently importing the CommonServerOptions (source) and using that to placate typescript:
Describe the bug
server
in the user config option calledmiddlewareMode
andserver
in thehmr
options are typed ashttp.Server
. But because thehttpServer
belonging to theViteDevServer
is typed as something less restrictive,ViteDevServer
's ownhttpServer
cannot be used asserver
in themiddlewareMode
orhmr
options for another vite config. This seems unnecessary, especially since doing so anyway (despite TypeScript's protests) still results in a working config.I intend to submit a PR for this issue.
Reproduction
https://github.com/emilefokkema/vite-server-type-reproduction
Steps to reproduce
Run
npm install
followed bynpm run typecheck
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: