Cannot get hot reload to work with Laravel Sail, Vite and Vue 3 #9155
Replies: 7 comments 18 replies
-
Maybe you are hitting this problem?
|
Beta Was this translation helpful? Give feedback.
-
Did you find a fix for this issue? I'm experiencing something similar, running npm run build compiles the assets and I can view them in the browser, running npm run dev starts the vite server but assets are not present in the browser. |
Beta Was this translation helpful? Give feedback.
-
just add this in your vite.config.js
run the command Note: I am using Docker WSL2 |
Beta Was this translation helpful? Give feedback.
-
I had a similar issue, I ran Fixed by closing by VS Code instance, realoaded via terminal with Hope it helps someone else. |
Beta Was this translation helpful? Give feedback.
-
I'm running Laravel sail using WSL2 in Debian and following the directions, I was able to get Vite to work and refresh but it was very slow. I found an online suggestion to run Vite in Powershell instead. This works and it's fast. |
Beta Was this translation helpful? Give feedback.
-
Things seem to work the moment I head into docker-desktop, find the container running laravel (for us that's via octane), clicking the terminal tab, and then run Given the involvement of sail, could this be an issue specifically be something weird with |
Beta Was this translation helpful? Give feedback.
-
server: { |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
After many hours, I have been unable to get hot reload working with Vite on Laravel Sail. The following is my
vite.config.ts
file:I've also tried with:
And in my
docker-compose.yml
:And finally my scripts in
package.json
:After running
sail npm run dev
, I get:However, after navigating to
http://localhost:8081
(I have set myAPP_PORT=8081
), the browser does not reload when there are changes. I am following the Laravel/Vite/Inertia format here andsail npm run build
seems to build the project as expected with no errors.Reproduction
Running sail with:
Then running npm dev with:
System Info
Using Laravel sail on Windows 10 with WSL 2...
Used Package Manager
npm
Logs
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions