sail: Laravel Sail share via expose doesn't seem to function at all

  • Laravel Version: 8.29.0
  • PHP Version: 8.0.2
  • Database Driver & Version: N/A

Description:

Originally posted as a discussion, but it seems I’m not the only one with this issue so I thought I would escalate into a bug report.

Trying to share my Laravel site with my phone to do some testing via Laravel Sail.

So I type in sail share and get the usual output. When I visit the dashboard URL that appears on my Mac, I get Site cannot be reached.

When I try to visit the URL generated by sail locally and via my phone, I get ERR_EMPTY_RESPONSE in Chrome.

Not sure whats going on? I’m using Docker Desktop for Mac. Am I doing something wrong here?

Steps To Reproduce:

  1. Install Laravel on MacOS
  2. Install Laravel Sail with the PHP 8 runtime
  3. Make sure your Laravel welcome page is showing locally
  4. Run sail share to start sharing your site
  5. See that you cannot visit the shared site with the given link
  6. See that you also cannot see the dashboard

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 18 (7 by maintainers)

Most upvoted comments

This is still broken for me after removing/reinstalling the image as recommended. I can get to the expose dashboard where you can follow the requests, but trying to use the expose url without the port gives me a 404, and the url with the port just spins forever and never does anything.

This issue exists only on linux hosts. I submitted a pull request to beyondcode/expose repository which fixes the issue. Link to PR: beyondcode/expose#293

Just to expand on this, as it’s still an issue in sail, for Linux users.

  1. Find and open your sail file (spoiler, it’s just a bash script): /laravel_app/vendor/laravel/sail/bin/sail
  2. For me it’s on line 470, but just search for beyondcodegmbh/expose-server
  3. Then add in --add-host=host.docker.internal:host-gateway into the docker run command. I put it in between --rm and -p
  4. Save, and re-run sail share

And it should now work.

Pushed up a patch.

This is still broken for me after removing/reinstalling the image as recommended. I can get to the expose dashboard where you can follow the requests, but trying to use the expose url without the port gives me a 404, and the url with the port just spins forever and never does anything.

This issue exists only on linux hosts. I submitted a pull request to beyondcode/expose repository which fixes the issue. Link to PR: https://github.com/beyondcode/expose/pull/293

I also got it working now after I cleared out all beyondcodegmbh/expose-server images from Docker, thanks!

Yeah it’s broken for me as well. I’ll check in with @mpociot.

This issue has seemed to reappear for me using Windows / WSL2

I just tried out a fresh install on macOS and it works for me. I was using an old image it seems. Make sure ALL of your containers/images are cleared before trying again.

Yeah, can confirm. It’s broken for me as well again.

Thanks for the speedy patch @taylorotwell @driesvints 👍