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

rangerblue's avatar

laravel sail issue

I am working on a project using Laravel, Inertia, React, and Sail. However, when I try to edit the view with on the view page, the changes do not take effect unless I run sail npm run dev. Is there a way to run sail up without having to run sail npm run dev in a separate terminal?

1 like
3 replies
tykus's avatar

the changes do not take effect unless I run sail npm run dev

Well, you must compile your template in order for the changes to take effect. If you are working in local development, you should have hot-module reloading (HMR) available while Vite is running. If you are using WSL2, then there are specific instructions in the Laravel docs

2 likes
rangerblue's avatar

@tykus I've added it, but it still does the same. When running sail npm run dev, it just changes, but if running sail npm run dev there is no change in the view.

import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
import react from '@vitejs/plugin-react';

export default defineConfig({
    plugins: [
        laravel({
            input: "resources/js/app.jsx",
            refresh: true,
        }),
        react(),
    ],
    server: {
        hmr: {
            host: "localhost",
        },
        watch: {
            usePolling: true,
            interval: 100,
        },
    },
});

Please or to participate in this conversation.