Skip to content

Commit 5c0e40a

Browse files
committed
fix: dev-remote hmr port override
1 parent b9e27aa commit 5c0e40a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cmd/workspace/apps/vite-server.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ async function startViteServer() {
4848
clientPath
4949
);
5050
const userConfig = loadedConfig?.config ?? {};
51+
52+
/**
53+
* Vite uses the same port for the HMR server as the main server.
54+
* Allowing the user to set this option breaks the system.
55+
* By just providing the port override option, Vite will use the same port for the HMR server.
56+
* Multiple servers will work, but if the user has this in their config we need to delete it.
57+
*/
58+
delete userConfig.server?.hmr?.port;
59+
5160
const coreConfig = {
5261
configFile: false,
5362
root: clientPath,

0 commit comments

Comments
 (0)