S
SolidJS9mo ago
ap32

Hmr doesn't work with custom port

Everything works fine when I use default hmr settings. But it stops working when I configure the port.
import { defineConfig } from "@solidjs/start/config";
import UnoCSS from "unocss/vite";

export default defineConfig({
vite: {
server: {
port: 3000,
strictPort: true,
hmr: {
port: 64314
}
// hmr: {
// protocol: "wss",
// port: 22300,
// clientPort: 443,
// path: "hmr/"
// },
},
plugins: [UnoCSS()],
},
});
import { defineConfig } from "@solidjs/start/config";
import UnoCSS from "unocss/vite";

export default defineConfig({
vite: {
server: {
port: 3000,
strictPort: true,
hmr: {
port: 64314
}
// hmr: {
// protocol: "wss",
// port: 22300,
// clientPort: 443,
// path: "hmr/"
// },
},
plugins: [UnoCSS()],
},
});
It also writes Websocket socket error:
vinxi v0.3.10
vinxi starting dev server
WebSocket server error: Port is already in use
WebSocket server error: Port is already in use (x2)

➜ Local: http://localhost:3000/
➜ Network: use --host to expose
vinxi v0.3.10
vinxi starting dev server
WebSocket server error: Port is already in use
WebSocket server error: Port is already in use (x2)

➜ Local: http://localhost:3000/
➜ Network: use --host to expose
I need this to be able to work with code in a docker container
1 Reply
gitinit
gitinit9mo ago
I would look at this issue on Github. https://github.com/solidjs/solid-start/issues/1364 This got me pass the websocket port errors but I still haven't got HMR fully working yet 😦
GitHub
[Bug?]: Unable to use HMR with docker local setup · Issue #1364 · s...
Duplicates I have searched the existing issues Latest version I have tested the latest version Current behavior 😯 Pages load in dev mode fine. However, when I save changes, there is no hot reloadin...
Want results from more Discord servers?
Add your server