-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
fix: allow controlling hmr bind host #13692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 8 Skipped Deployments
|
finalConfig.server.hmr = {} | ||
} | ||
finalConfig.server.hmr.server = hmrServer | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: HMR Configuration Overwrites and Error Handling
The HMR_BIND_HOST
setup has a few issues. The hmrServer.listen()
call lacks error handling, risking process crashes from port conflicts or invalid hosts, and causing EADDRINUSE
on repeated calls to getViteConfig()
. This logic also unintentionally overwrites user-defined HMR configurations, potentially re-enabling HMR when it was explicitly disabled. Lastly, createServer
uses CommonJS require()
inconsistently with the file's ES6 imports.
trick to make it easier to control where the hmr server binds. usefuly when running medusa dev through proxies, docker containers, etc.