diff --git a/packages/bundler-webpack/src/server/server.ts b/packages/bundler-webpack/src/server/server.ts index 9d6b2e0c5081..42be546fa70f 100644 --- a/packages/bundler-webpack/src/server/server.ts +++ b/packages/bundler-webpack/src/server/server.ts @@ -247,7 +247,7 @@ export async function createServer(opts: IOpts): Promise { console.log(`[SOCKET_SERVER] hmr port changed from ${port} to ${basePort}`) return undefined; } - return Number(startPort) === basePort ? undefined : (Number(startPort) || undefined); + return startPort === basePort ? undefined : startPort; }; ws = createWebSocketServer(server, await parseSocketServerAddress());