beyondcode / herd-community

79 stars 1 forks source link

[Bug]: Windows herd loopback command causes PHP warning #905

Open godismyjudge95 opened 1 month ago

godismyjudge95 commented 1 month ago

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]
mechelon commented 1 month ago

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?

godismyjudge95 commented 1 month ago

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