Skip to content

Conversation

srindom
Copy link
Collaborator

@srindom srindom commented Oct 6, 2025

trick to make it easier to control where the hmr server binds. usefuly when running medusa dev through proxies, docker containers, etc.

@srindom srindom requested a review from a team as a code owner October 6, 2025 10:52
Copy link

changeset-bot bot commented Oct 6, 2025

⚠️ No Changeset found

Latest commit: 20d0838

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Oct 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

8 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
api-reference Ignored Ignored Oct 10, 2025 7:57am
api-reference-v2 Ignored Ignored Preview Oct 10, 2025 7:57am
cloud-docs Ignored Ignored Preview Oct 10, 2025 7:57am
docs-ui Ignored Ignored Preview Oct 10, 2025 7:57am
docs-v2 Ignored Ignored Preview Oct 10, 2025 7:57am
medusa-docs Ignored Ignored Preview Oct 10, 2025 7:57am
resources-docs Ignored Ignored Preview Oct 10, 2025 7:57am
user-guide Ignored Ignored Preview Oct 10, 2025 7:57am

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

finalConfig.server.hmr = {}
}
finalConfig.server.hmr.server = hmrServer
}
Copy link

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.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant