native:serve
hangs with no window and cURL
error 7 (but native:build
works
#609
Labels
bug
Something isn't working
Uh oh!
There was an error while loading. Please reload this page.
What were you trying to do?
I was trying to run my NativePHP app in development mode using the php artisan
native:serve
command. My goal was to launch the application with hot-reloading during development.What happened?
After a seemingly successful build and startup process, the app icon appears in the macOS Dock, but no window is displayed. I expected the main application window to open.
Additionally, the right-click menu on the Dock icon has disabled Quit, and I can only force-quit the app.
Running
php artisan native:build
works as expected — the application builds and launches correctly with a visible window.How to reproduce the bug
Set up a fresh Laravel project with NativePHP on macOS
Run:
composer require nativephp/electron
Run:
php artisan native:install
Run:
php artisan native:serve
Observe the following:
The console logs indicate that everything runs successfully.
However, no window appears.
Electron app icon shows up in the Dock but is unresponsive.
Debug Output
Which operating systems have you seen this occur on?
macOS
Notes
The error in the terminal refers to a cURL error 7:
bash
Copy code
[NATIVE_EXCEPTION]: cURL error 7: Failed to connect to localhost port 4000 after 0 ms: Could not connect to server
This seems like a race condition — the PHP server might not yet be ready to receive requests when native:config is executed.
The text was updated successfully, but these errors were encountered: