From 5c0e40ad869185224db3a39528a4448b4c135bc7 Mon Sep 17 00:00:00 2001 From: MarioCadenas Date: Fri, 19 Dec 2025 12:37:10 +0100 Subject: [PATCH] fix: dev-remote hmr port override --- cmd/workspace/apps/vite-server.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/workspace/apps/vite-server.js b/cmd/workspace/apps/vite-server.js index 473f638231..e0ba85322a 100644 --- a/cmd/workspace/apps/vite-server.js +++ b/cmd/workspace/apps/vite-server.js @@ -48,6 +48,15 @@ async function startViteServer() { clientPath ); const userConfig = loadedConfig?.config ?? {}; + + /** + * Vite uses the same port for the HMR server as the main server. + * Allowing the user to set this option breaks the system. + * By just providing the port override option, Vite will use the same port for the HMR server. + * Multiple servers will work, but if the user has this in their config we need to delete it. + */ + delete userConfig.server?.hmr?.port; + const coreConfig = { configFile: false, root: clientPath,