Skip to content
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

[Bug]: App not opening after install #284

Closed
thegr8dev opened this issue May 1, 2024 · 23 comments
Closed

[Bug]: App not opening after install #284

thegr8dev opened this issue May 1, 2024 · 23 comments
Labels
bug Something isn't working

Comments

@thegr8dev
Copy link

What happened?

During the installation process of version 0.6.1, a "Microsoft JS compilation error" occurred, which was resolved upon clicking "OK," allowing the build to proceed successfully. However, upon attempting to launch the application post-installation, it fails to open without presenting any error messages.

Windows 11 (23H2) | Build : 22631.3447

How to reproduce the bug

  • Build Native PHP with win command.
  • Install the build setup.
  • Try to open the app and nothing will happen.

Package Version

0.6.1

PHP Version

8.1.2

Laravel Version

10.10

Node Version

18.17.0

Which operating systems does with happen with?

Windows

Notes

No response

@thegr8dev thegr8dev added the bug Something isn't working label May 1, 2024
@paulocardozo
Copy link

I'm facing this issue too. @simonhamp do you know anything about that?

@paulocardozo
Copy link

Adding more information. The process starts and can be viewed on Task Manager, but the application doesn't show any window.

image

@simonhamp
Copy link
Member

simonhamp commented May 1, 2024

Rather than running the installer, if you go into the dist/win-unpacked folder, are you able to run the .exe located in there?

(Be sure to force quit those stray processes)

@paulocardozo
Copy link

Rather than running the installer, if you go into the dist/win-unpacked folder, are you able to run the .exe located in there?

(Be sure to force quit those stray processes)

Yes. I've tried to run as admin too. Process starts but nothing happens after.

@simonhamp
Copy link
Member

@paulocardozo can you run composer show nativephp/* --format=json in the root of your app's development environment and past the output here please?

@paulocardozo
Copy link

paulocardozo commented May 1, 2024

@paulocardozo can you run composer show nativephp/* --format=json in the root of your app's development environment and past the output here please?

Sure. Follows.

{
    "installed": [
        {
            "name": "nativephp/electron",
            "direct-dependency": true,
            "homepage": "https://github.com/nativephp/electron",
            "source": "https://github.com/NativePHP/electron/tree/0.6.1",
            "version": "0.6.1",
            "description": "Electron wrapper for the NativePHP framework.",
            "abandoned": false
        },
        {
            "name": "nativephp/laravel",
            "direct-dependency": false,
            "homepage": "https://github.com/nativephp/laravel",
            "source": "https://github.com/NativePHP/laravel/tree/0.5.0",
            "version": "0.5.0",
            "description": "Laravel wrapper for the NativePHP framework.",
            "abandoned": false
        },
        {
            "name": "nativephp/php-bin",
            "direct-dependency": false,
            "homepage": "https://nativephp.com",
            "source": "https://github.com/NativePHP/php-bin/tree/0.4.0",
            "version": "0.4.0",
            "description": "PHP binaries used by the NativePHP framework",
            "abandoned": false
        }
    ]
}

@simonhamp
Copy link
Member

Thanks. Ok everything looks like it should be fine... my guess is that something on your system is blocking the app from booting.

I've put some debugging guides in the docs, could you have a go at this one and let me know if you find anything

@paulocardozo
Copy link

I think I know what's going on. I have multiple PHP versions installed, to run 8.1, I use php81 directive. nativephp package is copying the base php version (8.0) to folder instead of 8.1 (version used for this Laravel 10 project). I will try to replace default php to 8.1 and back with results.

@paulocardozo
Copy link

@simonhamp add me on LinkedIn if you can: https://www.linkedin.com/in/plneto.

I would like to talk directly with you and help to put this project ready to production.

@simonhamp
Copy link
Member

NativePHP doesn't have PHP8.0... it starts at 8.1.

@thegr8dev
Copy link
Author

Hi @simonhamp ,

As I checked in my system default php is 8.1.2 and I see binary that copied in build and without build

version is also same.

Without Build :-

image

With Build :-

image

@simonhamp
Copy link
Member

add me on LinkedIn if you can

I'd love to help in this way, but I feel that kind of direct support requires paying for some consulting time.

Hope you understand

@thegr8dev
Copy link
Author

PS :- This path should be corrected in docs, instead of this for dev build :-

C:\path\to\your\app\vendor\nativephp\resources\js\resources\php\php.exe -v

It should be :-

C:\path\to\your\app\vendor\nativephp\electron\resources\js\resources\php\php.exe -v

@paulocardozo
Copy link

@simonhamp well, my focus was on solve the issue, and help you to launch something that really works. But, no problem, wait you solve these issues. Cheers.

@simonhamp
Copy link
Member

my focus was on solve the issue, and help you to launch something that really works.

This is my focus too 🙂 we will just have to do that here in public and I can't guarantee my response time

But if you can wait, then no problem 👍🏼

@simonhamp
Copy link
Member

simonhamp commented May 1, 2024

Hi @simonhamp ,

As I checked in my system default php is 8.1.2 and I see binary that copied in build and without build

version is also same.

Without Build :-

image

With Build :-

image

@thegr8dev Were you able to execute those php.exe's in the CLI?

It looks from the screenshots you only executed your system PHP.

@thegr8dev
Copy link
Author

Hi @simonhamp ,
As I checked in my system default php is 8.1.2 and I see binary that copied in build and without build
version is also same.
Without Build :-
image
With Build :-
image

@thegr8dev Were you able to execute those php.exe's in the CLI?

It looks from the screenshots you only executed your system PHP.

Yep they are executing !

@paulocardozo
Copy link

@simonhamp I guess the problem is different versions of php (8.1.27/8.1.2/8.1.28). I was using php 8.1.27 and your package was using php 8.1.28. I've deleted the project and started a new/blank project to test. Soon I will be back with results.

@simonhamp
Copy link
Member

@thegr8dev

but app is opening now, and executing as well.

🎉 Will get those fixes in place in core soon

Now only above error is there which I'm looking what's going wrong.

I think that's a minor issue. The app can run despite it

@thegr8dev
Copy link
Author

@thegr8dev

but app is opening now, and executing as well.

🎉 Will get those fixes in place in core soon

Now only above error is there which I'm looking what's going wrong.

I think that's a minor issue. The app can run despite it

so here is what i did ignore the code comment above. I guess that was for solve that js compilcation error.

in .env file just add NATIVEPHP_APP_ID="com.foo.app" or any app id you want and rebuild the app.

Boom it will work !

@simonhamp
Copy link
Member

Good insight. I'll put a patch up soon that sets a sensible default

@thegr8dev thegr8dev reopened this May 5, 2024
@JeremieMercier
Copy link

@thegr8dev

but app is opening now, and executing as well.

🎉 Will get those fixes in place in core soon

Now only above error is there which I'm looking what's going wrong.

I think that's a minor issue. The app can run despite it

so here is what i did ignore the code comment above. I guess that was for solve that js compilcation error.

in .env file just add NATIVEPHP_APP_ID="com.foo.app" or any app id you want and rebuild the app.

Boom it will work !

It works for me too, thx !

@simonhamp
Copy link
Member

This was fixed in 0.5.1, but you will likely need to manually update your config/nativephp.php file if you have an older version (or force publish: native:install --force)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants