Dev server ping fails with secured Valet site
See original GitHub issue- Laravel Vite Plugin Version: 0.2.3
- Laravel Version: 9.x-dev 4d46bda
- Node Version: 16.15.0
- NPM Version: 8.5.5
- Chrome Version: 102.0.5005.115
- Firefox Version: 101.0.1
- Laravel Valet Version: 3.1.7
- macOS Version: 12.3.1 (M1)
Description:
When serving a local development site, e.g. valet-vite.test
, using Valet, after the site is secured with HTTPS using valet secure
the connection to wss://valet-vite.test:3000
fails, and all the pings to https://valet-vite.test/__vite_ping
404.
The errors look like this (screenshot is Firefox, errors are the same in Chrome).
Steps To Reproduce:
composer create-project laravel/laravel:9.x-dev valet-vite && cd valet-vite
valet link valet-vite && valet secure
- add
@vite('resources/js/app.js')
toresources/views/welcome.blade.php
- set
APP_URL
tohttps://valet-vite.test
npm install && npm run dev
Issue Analytics
- State:
- Created a year ago
- Comments:19 (13 by maintainers)
Top Results From Across the Web
Valet - Not serving in browser - Laracasts
My valet sites are responding when using ping on command line but are refusing to serve in the browser. Any help would be...
Read more >Server can not be found using Laravel Valet - Stack Overflow
Have linked a folder with valet link and secured it. But when trying in the browser I get the "Server not found..." error....
Read more >laravel valet not serving any site - Reddit
Hi,I'm just clean install macOS 12.6 and reinstall everything fresh and want to serve my site via laravel valet. Everything was fine with...
Read more >Laravel Valet - Laravel - The PHP Framework For Web Artisans
Once Valet is installed, try pinging any *.test domain on your terminal using a command such as ping foobar.test . If Valet is...
Read more >Making Vite and Valet play nice together - Freek.dev
For each site, I usually run valet secure so the site loads over HTTPS. And that is what is causing problems. By default,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, so I just tried and at least the following
server
configuration is needed forhttps
to work and the websocket to connect:The
host
is necessary because otherwise the websocket will try to connect usinglocation.hostname
.@jessarcher I think the
hmr
host should always be set, andhttps
should be auto-determined depending onAPP_URL
, likevite-plugin-laravel
does.I haven’t looked into why
ws://browser-hostname
works andwss://browser-hostname
doesn’t, but setting thehost
to the dev server’s host works in both cases.This is probably not Valet related. I have the same issue serving the local dev site with Lando (Docker).