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

Application dose not boot up. #400

Closed
sifz10 opened this issue Nov 4, 2024 · 4 comments
Closed

Application dose not boot up. #400

sifz10 opened this issue Nov 4, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@sifz10
Copy link

sifz10 commented Nov 4, 2024

What were you trying to do?

I just installed a fresh project with Laravel 11. Install the NativePHP then I am trying to run the application locally.

What happened?

Once I run the application, It doesn't show any error. Just show some log like this :

`$ php artisan native:serve

Starting NativePHP dev server…

Fetching latest dependencies…

Installing NPM dependencies (This may take a while)...

Installing NPM dependencies using the npm package manager...

Fetching latest dependencies…

Starting NativePHP app

Copying app icons...

App icons copied

Running the dev script with npm...

Fetching latest dependencies…`

Then the cmd turn off.

How to reproduce the bug

NativeAppServiceProvider.php

`namespace App\Providers;

use Native\Laravel\Facades\Window;
use Native\Laravel\Contracts\ProvidesPhpIni;
use Native\Laravel\Menu\Menu;

class NativeAppServiceProvider implements ProvidesPhpIni
{
public function boot(): void
{
Window::open()->width(400)->height(300);
}

public function phpIni(): array
{
    return [
        'memory_limit' => '512M',
        'display_errors' => '1',
        'error_reporting' => 'E_ALL',
        'max_execution_time' => '0',
        'max_input_time' => '0',
    ];
}

}
`

config/nativephp.php
`<?php

return [
/**
* The version of your app.
* It is used to determine if the app needs to be updated.
* Increment this value every time you release a new version of your app.
*/
'version' => env('NATIVEPHP_APP_VERSION', '1.0.0'),

/**
 * The ID of your application. This should be a unique identifier
 * usually in the form of a reverse domain name.
 * For example: com.nativephp.app
 */
'app_id' => env('NATIVEPHP_APP_ID', 'com.zoox.nativephp.app'),

/**
 * If your application allows deep linking, you can specify the scheme
 * to use here. This is the scheme that will be used to open your
 * application from within other applications.
 * For example: "nativephp"
 *
 * This would allow you to open your application using a URL like:
 * nativephp://some/path
 */
'deeplink_scheme' => env('NATIVEPHP_DEEPLINK_SCHEME'),

/**
 * The author of your application.
 */
'author' => env('NATIVEPHP_APP_AUTHOR'),

/**
 * The default service provider for your application. This provider
 * takes care of bootstrapping your application and configuring
 * any global hotkeys, menus, windows, etc.
 */
'provider' => \App\Providers\NativeAppServiceProvider::class,

/**
 * A list of environment keys that should be removed from the
 * .env file when the application is bundled for production.
 * You may use wildcards to match multiple keys.
 */
'cleanup_env_keys' => [
    'AWS_*',
    'GITHUB_*',
    'DO_SPACES_*',
    '*_SECRET',
    'NATIVEPHP_UPDATER_PATH',
    'NATIVEPHP_APPLE_ID',
    'NATIVEPHP_APPLE_ID_PASS',
    'NATIVEPHP_APPLE_TEAM_ID',
],

/**
 * A list of files and folders that should be removed from the
 * final app before it is bundled for production.
 * You may use glob / wildcard patterns here.
 */
'cleanup_exclude_files' => [
    'content',
    'storage/app/framework/{sessions,testing,cache}',
    'storage/logs/laravel.log',
],

/**
 * The NativePHP updater configuration.
 */
'updater' => [
    /**
     * Whether or not the updater is enabled. Please note that the
     * updater will only work when your application is bundled
     * for production.
     */
    'enabled' => env('NATIVEPHP_UPDATER_ENABLED', true),

    /**
     * The updater provider to use.
     * Supported: "github", "s3", "spaces"
     */
    'default' => env('NATIVEPHP_UPDATER_PROVIDER', 'spaces'),

    'providers' => [
        'github' => [
            'driver' => 'github',
            'repo' => env('GITHUB_REPO'),
            'owner' => env('GITHUB_OWNER'),
            'token' => env('GITHUB_TOKEN'),
            'vPrefixedTagName' => env('GITHUB_V_PREFIXED_TAG_NAME', true),
            'private' => env('GITHUB_PRIVATE', false),
            'channel' => env('GITHUB_CHANNEL', 'latest'),
            'releaseType' => env('GITHUB_RELEASE_TYPE', 'draft'),
        ],

        's3' => [
            'driver' => 's3',
            'key' => env('AWS_ACCESS_KEY_ID'),
            'secret' => env('AWS_SECRET_ACCESS_KEY'),
            'region' => env('AWS_DEFAULT_REGION'),
            'bucket' => env('AWS_BUCKET'),
            'endpoint' => env('AWS_ENDPOINT'),
            'path' => env('NATIVEPHP_UPDATER_PATH', null),
        ],

        'spaces' => [
            'driver' => 'spaces',
            'key' => env('DO_SPACES_KEY_ID'),
            'secret' => env('DO_SPACES_SECRET_ACCESS_KEY'),
            'name' => env('DO_SPACES_NAME'),
            'region' => env('DO_SPACES_REGION'),
            'path' => env('NATIVEPHP_UPDATER_PATH', null),
        ],
    ],
],

];
`

Package Versions

nativephp/electron : "0.8.1" | nativephp/laravel : 0.6.1| nativephp/php-bin : 0.5.4

PHP Version

8.2.0

Laravel Version

11.9

Node Version

20.18.0

Which operating systems have you seen this occur on?

Windows

OS version

win11

Notes

I tried with both. First, I installed fresh project without changing anything, Then I installed another fresh application and this time just added the window size and phpIni function.

@sifz10 sifz10 added the bug Something isn't working label Nov 4, 2024
@sifz10
Copy link
Author

sifz10 commented Nov 4, 2024

I got it! Forgot to install npm! 😑 When it says Installing NPM dependencies.... I thought it running npm under the hood!

@sifz10 sifz10 closed this as completed Nov 4, 2024
@simonhamp
Copy link
Member

Ah, yeh that's a bit of a misnomer... it's installing the nativephp/electron package's npm dependencies into your vendor folder, not installing your project's own npm dependencies.

@sifz10
Copy link
Author

sifz10 commented Nov 5, 2024

@simonhamp Thank you for the better explanation. Appreciate it. I think we need to add this instruction into the documentation installation process. So newbies like me don't get confused. 😅

@simonhamp
Copy link
Member

I'd rather figure out why this ends up being a problem... not everyone runs/needs npm

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

2 participants