herd-community icon indicating copy to clipboard operation
herd-community copied to clipboard

[Bug]: Windows herd loopback command causes PHP warning

Open godismyjudge95 opened this issue 1 year ago • 2 comments

Platform

Windows

Operating system version

Windows 11 Pro (22631.3880)

System architecture

Intel (x86)

Herd Version

1.9.0

PHP Version

No response

Bug description

This error weirdly only shows when running the loopback command if the current loopback is set to 127.0.0.1 Looks like the error is related to some mac paths that haven't been converted to Windows?

Steps to reproduce

  1. Run herd loopback 127.0.0.1 this usually doesn't cause the error but is needed to set up for error replication
  2. Run herd loopback 0.0.0.0
  3. See the error below

Relevant log output

PS C:\Users\user> herd loopback 0.0.0.0
[0.0.0.0] loopback interface alias added.
PHP Warning:  file_put_contents(/Library/LaunchDaemons/com.laravel.valet.loopback.plist): Failed to open stream: No such file or directory in phar://C:/Users/user/.config/herd/bin/herd.phar/cli/Valet/Filesystem.php on line 92

Warning: file_put_contents(/Library/LaunchDaemons/com.laravel.valet.loopback.plist): Failed to open stream: No such file or directory in phar://C:/Users/user/.config/herd/bin/herd.phar/cli/Valet/Filesystem.php on line 92
[/Library/LaunchDaemons/com.laravel.valet.loopback.plist] persistent loopback interface alias launch daemon added.
Restarting PHP 8.3...
Restarting NGINX...
Your Herd loopback address has been updated to [0.0.0.0]

godismyjudge95 avatar Jul 29 '24 04:07 godismyjudge95

Thanks for the info! Indeed, the loopback command was not implemented for the Windows version yet. Can you share your use case for it so we can see if it makes sense to implement it and how?

mechelon avatar Aug 13 '24 11:08 mechelon

Thanks for the info! Indeed, the loopback command was not implemented for the Windows version yet. Can you share your use case for it so we can see if it makes sense to implement it and how?

I believe the loopback command (or performing the same steps manually) is necessary to be able to share Herd sites with other devices on your network? My personal use case was to be able to open a website on my phone and tablet to test full responsiveness. I know I can do that with expose or ngrok but those don't work with Vite atm

godismyjudge95 avatar Aug 13 '24 13:08 godismyjudge95

Even the official Valet documentation no longer mentions the loopback command, so I'll close this issue.

If you want to share your sites locally, follow the steps mentioned in the Valet documentation:

https://laravel.com/docs/11.x/valet#sharing-sites-on-your-local-network

We will also add a section to our internal docs to explain this 👍

mpociot avatar Sep 25 '24 13:09 mpociot