Maybe we can help a bit better if you explain your set up? Valet? https://freek.dev/2276-making-vite-and-valet-play-nice-together
Jul 23, 2022
12
Level 8
Laravel Vite HMR not working with custom domain
HMR is not working for the custom domain.
import { defineConfig } from 'vite';
import laravel, { refreshPaths } from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: [
...refreshPaths,
'app/Http/Livewire/**',
],
}),
],
});
console errors:
19:23:57.038
GEThttps://example-app.test/login
[HTTP/1.1 200 OK 181ms]
19:23:57.216
GEThttp://127.0.0.1:5173/resources/css/app.css
[HTTP/1.1 304 Not Modified 83ms]
19:23:57.216
GEThttp://127.0.0.1:5173/@vite/client
[HTTP/1.1 304 Not Modified 17ms]
19:23:57.217
GEThttp://127.0.0.1:5173/resources/js/app.js
[HTTP/1.1 304 Not Modified 14ms]
19:23:57.240
GEThttp://127.0.0.1:5173/node_modules/.vite/deps/alpinejs.js?v=55ce4224
[HTTP/1.1 200 OK 0ms]
19:23:57.240
GEThttp://127.0.0.1:5173/resources/js/bootstrap.js
[HTTP/1.1 304 Not Modified 4ms]
19:23:57.242
GEThttp://127.0.0.1:5173/node_modules/vite/dist/client/env.mjs
[HTTP/1.1 304 Not Modified 2ms]
19:23:57.250
GEThttp://127.0.0.1:5173/node_modules/.vite/deps/lodash.js?v=55ce4224
[HTTP/1.1 200 OK 0ms]
19:23:57.251
GEThttp://127.0.0.1:5173/node_modules/.vite/deps/axios.js?v=55ce4224
[HTTP/1.1 200 OK 0ms]
19:23:57.252
GEThttp://127.0.0.1:5173/node_modules/.vite/deps/chunk-RSJERJUL.js?v=55ce4224
[HTTP/1.1 200 OK 0ms]
19:23:57.301 [vite] connecting... client.ts:19:8
19:23:57.302
GETwss://127.0.0.1:5173/
19:23:57.307
GEThttps://example-app.test/favicon.ico
[HTTP/1.1 200 OK 0ms]
19:23:57.320 Firefox can’t establish a connection to the server at wss://127.0.0.1:5173/. client.ts:78:17
19:23:57.623
GETwss://127.0.0.1:5173/
19:23:57.625 Firefox can’t establish a connection to the server at wss://127.0.0.1:5173/. client.ts:78:17
19:23:57.625
[vite] failed to connect to websocket.
your current setup:
(browser) 127.0.0.1:5173/ <--[HTTP]--> 127.0.0.1:5173/ (server)
(browser) 127.0.0.1:5173/ <--[WebSocket (failing)]--> 127.0.0.1:5173/ (server)
Check out your Vite / network configuration and https://vitejs.dev/config/server-options.html#server-hmr . client.ts:48:16
Level 102
8 likes
Please or to participate in this conversation.