-
-
Notifications
You must be signed in to change notification settings - Fork 193
[Bug]: TypeError: Cannot read properties of undefined (reading 'setIcon') #22
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
Comments
try to navigate to the code and disable the lines
|
The error for setIcon is fixed and the app success to run until database migration, the first error still exist and get new issue the binary cant executed. start electron app... [10137:0721/101839.138587:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser” Error: Command failed: /home/septiandev/Development/my-laravel-boilerplate/vendor/nativephp/electron/resources/js/resources/php artisan native:config
code: 126, API server started on port 4000 Starting PHP server... /home/septiandev/Development/my-laravel-boilerplate/vendor/nativephp/electron/resources/js/resources/php artisan serve /home/septiandev/Development/my-laravel-boilerplate Making sure app folders are available Migrating database... /home/septiandev/Development/my-laravel-boilerplate/vendor/nativephp/electron/resources/js/resources/php: /home/septiandev/Development/my-laravel-boilerplate/vendor/nativephp/electron/resources/js/resources/php: cannot execute binary file |
This is probably because the PHP binary used here is the MacOS binary. NativePHP does not support Linux yet (I've even read that somewhere but cannot find the source anymore; it's not in the docs). $ file vendor/nativephp/electron/resources/js/resources/php
vendor/nativephp/electron/resources/js/resources/php: Mach-O 64-bit x86_64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE> |
Fixed, but got new issue Error: Command failed: /home/tochiv/PhpstormProjects/testNative/vendor/nativephp/electron/resources/js/resources/php artisan native:config
code: 2, API server started on port 4000 Migrating database... /home/tochiv/PhpstormProjects/testNative/vendor/nativephp/electron/resources/js/resources/php: 1: ���� libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null) Linux |
I managed to use the project in Ubuntu After you run php artisan native:install, say no when it ask you to run the server. Then, copy you php file from /usr/bin/php to nativephp/vendor/nativephp/php-bin/bin/mac/x86. After that when you run php artisan native:run it will use your php library instead of the mac php library version |
@antonioanerao thank you for that information! I've added a few more details below. Steps:
sed -i 's/app.dock.setIcon(state_1.default.icon);/\/\/app.dock.setIcon(state_1.default.icon);/g' vendor/nativephp/electron/resources/js/node_modules/nativephp-electron/dist/index.js
cp -L /usr/bin/php vendor/nativephp/php-bin/bin/mac/x86/php
Here's a gist with a script |
works for linux mint 21 , thanks |
You probably don't want to copy the executable built on your platform as it's most likely dynamically linked. This will likely only work on your machine This means it won't be distributable to other machines when you come to package up your app for distribution. You need a static build of PHP specifically for Linux. First-party Linux support is coming very soon (we've already built the binaries, we just need to package 8000 them up) |
Bug fixed for demo for Linux OS: second comment the setIcon issue: finally, |
That's just a way to hack around while we wait for the linux support :D We want to play with NativePHP. I`m already making some nice stuff just for fun. |
The |
What happened?
I getting this error when run my laravel app with nativephp
[7075:0721/100333.390724:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/portal/desktop: org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.portal.FileChooser”
[7075:0721/100333.390847:ERROR:select_file_dialog_linux_portal.cc(274)] Failed to read portal version property
(node:7075) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading 'setIcon')
at NativePHP. (/home/septiandev/Development/my-laravel-boilerplate/vendor/nativephp/electron/resources/js/node_modules/nativephp-electron/dist/index.js:81:26)
at Generator.next ()
at /home/septiandev/Development/my-laravel-boilerplate/vendor/nativephp/electron/resources/js/node_modules/nativephp-electron/dist/index.js:8:71
at new Promise ()
at __awaiter (/home/septiandev/Development/my-laravel-boilerplate/vendor/nativephp/electron/resources/js/node_modules/nativephp-electron/dist/index.js:4:12)
at /home/septiandev/Development/my-laravel-boilerplate/vendor/nativephp/electron/resources/js/node_modules/nativephp-electron/dist/index.js:78:36
(Use
electron --trace-warnings ...
to show where the warning was created)(node:7075) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag
--unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)How to reproduce the bug
When i run native:serve command it give me this error
Package Version
0.1.0
PHP Version
8.1
Laravel Version
10.2
Which operating systems does with happen with?
Linux
Notes
No response
The text was updated successfully, but these errors were encountered: