Skip to content

DevDependencies wrong compiled during build process desktop #684

@carolina-cza

Description

@carolina-cza

What were you trying to do?

I tried to build the native desktop app.

What happened?

the build failed through dependencies errors

How to reproduce the bug

used version:

Node.js : 22.18.0
php: 8.4

config/nativphp.php:

'prebuild' => [
         'npm run build',
    ],

    'postbuild' => [
        // 'rm -rf public/build',
    ],

composer.json (how it is per default):

"require": {
       "php": "^8.2",
       "laravel/framework": "^12.0",
       "laravel/tinker": "^2.10.1"
      
   },
   "require-dev": {
"nativephp/electron": "^1.2",
        "fakerphp/faker": "^1.23",
       "laravel/pint": "^1.13",
       "laravel/sail": "^1.41",
       "mockery/mockery": "^1.6",
       "nunomaduro/collision": "^8.6",
       "pestphp/pest": "^3.8",
       "pestphp/pest-plugin-laravel": "^3.2"
      
   },

if you run the build:

php artisan native:build win

The build will not go through.

However, if you change the dependencies like this:
composer.json

"require": {
        "php": "^8.2",
        "laravel/framework": "^12.0",
        "laravel/tinker": "^2.10.1",
        "nativephp/electron": "^1.2",
         "fakerphp/faker": "^1.23",
        "laravel/pint": "^1.13",
        "laravel/sail": "^1.41",
        "mockery/mockery": "^1.6",
        "nunomaduro/collision": "^8.6",
        "pestphp/pest": "^3.8",
        "pestphp/pest-plugin-laravel": "^3.2"
    },
    "require-dev": {
       
    },

And delete the following files:

  • dist file
  • bootstrap/cache (All the files inside it because the following terminal input doesn't clear the cache located in Bootstrap.)
  • run 'php artisan cache:clear'
  • in AppData the laravel.exe
    => Essentially, just reset the entire native app to its original, clean version before building.

Then run it again:

php artisan native:build win

I was able to install and open it perfectly.

Debug Output

not available

Which operating systems have you seen this occur on?

Windows

Notes

I want to know why I have to take this step for the build myself, because it isn't mentioned in the documentation at all. Is this intentional? Also, I would like to point out that the documentation lacks some information in general.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions