-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vite HMR Websocket Connection failed #413
Comments
@swalker326 The error happens client side. |
ive tried it again it cant connect:
Maybe it is relevant that i am running it from WSL2.
Ive also tried running in inkognito mode to make sure no browser extensions are interfering but the result is the same. |
Interesting, do you see the same error when you run |
No. The default remix template works fine. |
i haven't experienced this either and we're not doing anything different than the official templates do in the vite config |
Its not a huge problem. The workaround ive posted works and I just wanted to document it here in case someone else has the same problem. Ive you need more info about my environment tell me. Otherwise we can close this too. Heres my current solution. It seems only the host is relevant. // vite.config.ts
import {vitePlugin as remix} from "@remix-run/dev";
import {defineConfig} from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
envDir: "./",
server: {
hmr: {
host: "localhost"
}
},
plugins: [
remix({
future: {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
},
}),
tsconfigPaths(),
],
}); |
When creating a new project and also on my existing project I get the following error when running
npm run dev
in the browser:To fix this issue I have to set the host to localhost in vite hmr options:
The text was updated successfully, but these errors were encountered: