Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

maikeltweak's avatar

Vite refreshing page while changing inputs in the browser (Livewire)

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',
        },
    },
});
0 likes
4 replies
maikeltweak's avatar

@Sinnbeck Thanks for your reply. I've added the plugin and will check if the problem doesn't come back during development today ;)

maikeltweak's avatar

So far so good, haven't see any weird behavior after installing the plugin. Thanks a lot @sinnbeck .

Please or to participate in this conversation.