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,