People searching “Vite HMR Sail” see the page and no updates when they save a Vue file. The browser on the host cannot reach the dev server’s advertised host inside Docker. The Sail guide already has this block. The Vite guide is the asset URL. This page is the hostname.
TL;DR
- Sail on WSL2 needs the HMR host set to localhost.
- Do not remove the kit’s Vite plugins to add that block.
- Do not set the HMR host to a hostname that only resolves inside the container.
- Do not delete
public/hotby hand while the dev server is running and expect it to stay gone.
The fix#
server: {
hmr: {
host: "localhost",
},
},Put it on the existing defineConfig. Leave the Laravel, Vue, and Tailwind plugins the kit generated. Restart ./vendor/bin/sail npm run dev.
public/hot appears while that process is running. It must not be deployed. The deploy guide covers that file.
What to avoid#
Gotcha
Do not set the HMR host to a hostname that only resolves inside the container. The browser is the thing opening the socket. Do not delete public/hot by hand while the dev server is running and expect it to stay gone. The server writes it back.
FAQ#
How do I point Vite HMR at localhost under Sail?
Sail on WSL2 needs the HMR host set to localhost. Do not remove the kit's Vite plugins to add that block.
What goes wrong with Vite HMR Sail?
Many developers see the page and no updates when they save a Vue file. Do not set the HMR host to a hostname that only resolves inside the container.



