Use the livewire plugin https://github.com/def-studio/vite-livewire-plugin
Haven't had any problems like that. Are you using tailwind?
Any chance your app.js looks into a wrong folder?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have an issue with Vite in combination with Livewire where it seems to reload the page when i change something in the livewire component im working on.
Example: I have an input field called name and once i type something in it, vite thinks it needs to reload the page. This happens without errors in console or in the laravel.log.
I would expect that vite would only refresh the page if i change something in blade and not on the actual frontend?
We just migrated from webpack to vite and the issue wasn't there before that. Sometimes (after multiple refreshes) the problem disappears. But then just randomly comes back.
Just to be 100% clear: I'm not changing anything in my IDE, but in the actual browser.
Anyone has any idea's what might cause this?
This is my vite.config:
import {defineConfig} from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
server: {
hmr: {
host: 'localhost',
},
},
plugins: [
laravel({
input: [
'resources/css/app.css',
'resources/js/app.js',
],
refresh: false
}),
],
resolve: {
alias: {
'@': '/resources/js',
},
},
});
Use the livewire plugin https://github.com/def-studio/vite-livewire-plugin
Haven't had any problems like that. Are you using tailwind?
Any chance your app.js looks into a wrong folder?
Please or to participate in this conversation.