Replies: 2 comments
-
|
From the Vite config docs, these two switches control different things:
So there isn't a separate third "disable both together" flag because those are already the two knobs. If you're still seeing an overlay after setting So the intended config would be: export default defineConfig({
server: {
hmr: false,
},
})or, if you still want HMR but not the overlay: export default defineConfig({
server: {
hmr: {
overlay: false,
},
},
})If you can share what exact overlay/error is still appearing, that would help confirm whether it's coming from HMR or from a different dev-server path. |
Beta Was this translation helpful? Give feedback.
-
|
Adding to @chrisjcthomas's answer: if you're still seeing an overlay after setting The way the two flags relate, internally:
There's no third "disable both" option because the two above are already the two knobs. What catches people out is that framework plugins ship their own overlays, wired to the same WebSocket but drawn independently. If you still see an overlay after turning Vite's off: // @vitejs/plugin-vue
vue({ devToolsEnabled: false })
// @vitejs/plugin-react
react({ overlay: false })Also worth checking for So the configs you already have are the intended shapes: // disable HMR and overlay together
export default defineConfig({
server: { hmr: false },
})
// keep HMR, just lose the overlay
export default defineConfig({
server: { hmr: { overlay: false } },
})If an overlay still renders after |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When I set server.hmr to false, the server.hmr.overlay functionality is still enabled;
When I set server.hmr.overlay to false, the server.hmr functionality remains enabled;
It appears impossible to disable both.
Beta Was this translation helpful? Give feedback.
All reactions