-
Notifications
You must be signed in to change notification settings - Fork 154
Vite triggers reload for any file in any folder #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@robsontenorio, can you please check your Tailwind CSS config file and see if the If it is there, this issue is caused by Tailwind. Tailwind creates a circular dependency which forces Vite to perform a full-page reload. You can test this out by leaving the This is a known issue in Vite that I'm not sure can really be addressed: vitejs/vite#9512 (comment) |
Hey @timacdonald , it is a default Laravel 12 project template with Tailwind 4. There is no tailwind config file it relies on “app.css”. https://github.com/laravel/laravel/blob/12.x/resources/css/app.css But, the odd part is that Vite trigger reloads for all folders. Is that a known issue ? |
If you comment out In regards to other files, it wasn't intentional and I'm open to excluding them by default (#152 (comment)). This shouldn't really be the cause of your current troubles, though. Vite only refreshes when it needs to even if you change files it is watching. |
@timacdonald If I comment out But, the annoying part is that it watches all other folder and files ... Example:
|
@robsontenorio, could you remove all |
Removed all @source , but it still trigger for other folders. More context
See here a brand new Laravel 12 template, with Livewire starer kit. It triggers a refresh for other folders. bug2.mov |
Hey @timacdonald , let me know if you need more info. Because even with “refresh: false” I have the same issue. Can you reproduce this issue on a fresh new Laravel 12 app ? |
Can you try changing the first line of app.css to: @import "tailwindcss" source(none);
|
@robsontenorio, I've been able to reproduce the issue. I'll have to spend some time pulling down the Tailwind plugin and Vite itself to debug what is actually happening here. I'm relatively sure this is a Tailwind plugin issue, as I can remove the issue by commenting the plugin out. |
I just ran into this problem myself. Based on the comment above by timacdonald, I downgraded the tailwind/vite plugin to |
Unfortunately, did not work for me when downgrading Here is my "devDependencies": {
"@tailwindcss/vite": "4.1.2",
"axios": "^1.8.2",
"daisyui": "^5.0.17",
"laravel-vite-plugin": "^1.2.0",
"tailwindcss": "^4.1.3",
"vite": "^6.2.5"
} |
Hello @Daedalus11069, it doesn't work for me either. |
We solve the issue by adding that in the main object returned of
|
@coclav Actually you are only disabling some features, so it is not solved 😢 . As @timacdonald said, there is some bug somewhere in Vite / Tailwind, that need a fix. |
Laravel Version
12.7.2
PHP Version
8.4.2
Spec
NPM 10.9.0
macOS 15.3.2
Description
After upgrading from Laravel 11 to 12, I have noticed this strange issue where Vite triggers full page reload for any file in any folder changed.
I am using the default settings for
vite.config.js
andapp.css
As the docs say, not all folders will be watched.
https://laravel.com/docs/12.x/vite#blade-refreshing-on-save
Steps To Reproduce
npm run
dev oryarn dev
storage/framework/***
changes.config/***
ordatabase/***
, it will also refresh.The text was updated successfully, but these errors were encountered: