Skip to content

native:serve hangs with no window and cURL error 7 (but native:build works #609

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
unknownman opened this issue Jun 4, 2025 · 4 comments
Labels
bug Something isn't working

Comments

@unknownman
Copy link

unknownman commented Jun 4, 2025

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

Environment
- PHP Version: 8.3.21
- PHP Path: /Users/alijoder/Library/Application Support/Herd/bin/php83
- Laravel Version: 12.17.0
- Laravel Config Cached: false
- Laravel Routes Cached: false
- Laravel Debug Enabled: true
- Node Version: v22.14.0
- Node Path: /Users/alijoder/Library/Application Support/Herd/config/nvm/versions/node/v22.14.0/bin/node
- NPM Version: 10.9.2
- NPM Path: /Users/alijoder/Library/Application Support/Herd/config/nvm/versions/node/v22.14.0/bin/npm
- OS: Darwin (macOS Apple Silicon)

NativePHP
- nativephp/electron: 1.1.0.0
- nativephp/laravel: 1.1.0.0
- nativephp/php-bin: 1.0.2.0
- Provider: App\Providers\NativeAppServiceProvider
- Notarization: disabled
- Custom PHP Binary: none

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.

@unknownman unknownman added the bug Something isn't working label Jun 4, 2025
@kyagie
Copy link

kyagie commented Jun 4, 2025

Try downgrade symfony/console to 7.2.7 by running this in your project root.

composer require symfony/console 7.2.7

@mihir-differenz
Copy link

Try downgrade symfony/console to 7.2.7 by running this in your project root.

composer require symfony/console 7.2.7

Thanks, Its working for linux

@andreamarelli
Copy link

Possible duplicate of #604

@PeteBishwhip
Copy link
Member

Correct, this is a duplicate. I'll be closing this in favour of #604

@NativePHP NativePHP locked and limited conversation to collaborators Jun 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants