Description
Currently the hot file will only store one interface address
eg: vite --host 0.0.0.0
will output http://0.0.0.0:7894
, However you cannot connect to 0.0.0.0 directly.
Let say you have a system that has 2 network interfaces like 10.5.0.5 and 172.26.80.1, so then you can connect to either of these externally, and 127.0.0.1 internally
So having http://0.0.0.0:7894
is not valid.
what i've done to fix this is (as a workaround for now), i just put all my network addresses ( that vite already gives me ) in the hotfile
eg: vite --host 0.0.0.0
will give me
➜ Local: http://localhost:7894
➜ Network: http://192.168.1.182:7894
➜ Network: http://192.168.137.1:7894
➜ Network: http://172.26.80.1:7894
and tell laravel to use whatever host is being used.
if i go to my laravel url (http://172.26.80.1:8000
), it will give me
<script type="module" src="http://172.26.80.1:7894/@vite/client" />
<script type="module" src="http://172.26.80.1:7894/resources/js/app.jsx" />
There are other issues like it outputs the ipv6 loopback http://[::1]:7894
when no --host is given
which also doesn't work when fetching the assets.
And also where the given base
isn't appended at the end, eg: when i set my vite.config
with base: '/something/'
i expect also to have http://172.26.80.1:7894/something
in my hotfile
But i think there are open or closed issues regarding these 2 ...
I'm not sure if i was clear enough with my explanation, i hope it make sense 😅
and please do tell me if there is anything i can help out with 👍
My configuration
- Laravel Vite Plugin Version: 0.7.3
- Laravel Version: 9.48.0
- Node Version: LTS-18.12.1
- NPM Version: 8.19.2
- Host operating system: Windows 11
- Running in Sail / Docker: No