-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Add information for running the Vite dev server when hosting Laravel in a VM #8021
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
Conversation
I would rather we didn't merge this as it currently is, as I can happily run Vite in Sail without any extra work.
The above shows me my site with Vite served assets via HMR. I think the fix is just a config option that we should be releasing this week, so I'd rather we get that confirmed as the fix and document that rather than pushing everyone to install node on their local machine. |
Totally agree it would be preferable to not require node on the host. I'm not sure if I'm alone in not realising I need to run the npm commands through Sail. I see now the docs mention it once under the Installing Node section. Do you think that could be more prominent, or explicitly say that all the node/npm commands should be prefixed with |
@timacdonald did you do that with WSL2? (or Sail on Mac?)
I am starting the server with In browser the app is attempting to load the HMR server and the assets from |
@mike-healy I'm on Mac. WSL2 is a known issue that we are working on improving, which is the intention of this PR: laravel/vite-plugin#42 , which is yet to be tagged. |
Thanks @timacdonald. I'll try it again after that release |
Nice. Should be available tomorrow to play with. |
@mike-healy were you able to try this? |
@driesvints – yes I did. No luck for me unfortunately. |
Just a note, WSL2 doesn't push file changes to the host and viceversa, so any file-change notification ( Dunno on the macOS side of things. |
It shouldn't be avoided at all costs. As per the Vite docs...
|
Any movement here? Otherwise it's best that we close this for now. |
Gonna close this for now. Feel free to reopen when you want to continue work on this. |
This info is based on discoveries using Vite with an app running in Laravel Sail. I needed to call
npm run dev
from my host machine in order for HMR to work. Others mentioned similar issues with Homestead on the issue discussion here.