I have a fresh Laravel 9 installed. I have run npm install, included @vite(['resources/css/app.css', 'resources/js/app.js']) in the head tag, and started the vite server but when I change something in the welcome.blade.php the page doesn't refresh and I'm not getting any errors. I've checked out the documentation but I haven't noticed missing anything.
Vite config file
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
plugins: [
laravel({
input: ['resources/css/app.css', 'resources/js/app.js'],
refresh: true,
}),
],
});
I just ran into the same issue and it turns out the welcome.blade.php file does not have the @vite(...) directive.
If you change a blade file that uses the layout files (guest.blade.php or app.blade.php), which have the @vite(...) directive, then the change will be reflected in the browser once the file is saved.
(Thank you to Billion Shiferaw for his comment above which steered me in the right direction.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With