- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 6
 
Description
What were you trying to do?
After the update of an existing project from v1 to v2.0.1, I can still run the build process for (and under) Windows. The output doesn't show any errors. However, the generated standalone EXE file under /nativephp/electron/dist/win-unpacked won't launch. It will spawn processes, but the window doesn't show up. Console will show a Command "native:config" is not defined error (see full output below).
When I switch back to the v1 branch and run the build process in the same way, it works.
Setting up an entirely new project with NativePHP v2, everything works as expected. I assume that it's an issue with my setup, but having followed the upgrade guide carefully, I can't wrap my head around what I'm missing here.
What happened?
The application cannot start correctly.
When I try to execute the application from PowerShell, I get the following output:
Error: Command failed: C:\Stash\nativephp\electron\dist\win-unpacked\resources\build\php\php.exe artisan native:config
    at genericNodeError (node:internal/errors:983:15)
    at wrappedFn (node:internal/errors:537:14)
    at ChildProcess.exithandler (node:child_process:417:12)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1101:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'C:\\Stash\\nativephp\\electron\\dist\\win-unpacked\\resources\\build\\php\\php.exe artisan native:config',
  stdout: '\n' +
    '   ERROR  Command "native:config" is not defined. Did you mean one of these?  \n' +
    '\r\n' +
    '  ⇂ livewire:configure-s3-upload-cleanup  \n' +
    '  ⇂ make:config  \n' +
    '  ⇂ native:build  \n' +
    '  ⇂ native:db:wipe  \n' +
    '  ⇂ native:debug  \n' +
    '  ⇂ native:install  \n' +
    '  ⇂ native:migrate  \n' +
    '  ⇂ native:migrate:fresh  \n' +
    '  ⇂ native:publish  \n' +
    '  ⇂ native:reset  \n' +
    '  ⇂ native:run  \n' +
    '  ⇂ native:seed  \n' +
    '  ⇂ native:serve  \r\n' +
    '\r\n',
  stderr: ''
}
(node:17220) UnhandledPromiseRejectionWarning: TypeError: Error processing argument at index 0, conversion failure from undefined
    at Object.setAppUserModelId (file:///C:/Stash/nativephp/electron/dist/win-unpacked/resources/app.asar/node_modules/@electron-toolkit/utils/dist/index.mjs:16:11)
    at NativePHP.setAppUserModelId (file:///C:/Stash/nativephp/electron/dist/win-unpacked/resources/app.asar/out/main/index.js:2625:17)
    at NativePHP.<anonymous> (file:///C:/Stash/nativephp/electron/dist/win-unpacked/resources/app.asar/out/main/index.js:2583:12)
    at Generator.next (<anonymous>)
    at fulfilled (file:///C:/Stash/nativephp/electron/dist/win-unpacked/resources/app.asar/out/main/index.js:2509:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
(Use `[app-name] --trace-warnings ...` to show where the warning was created)
(node:17220) 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: 3)
How to reproduce the bug
Under Windows 11, PHP 8.4 and Node JS 22, create a new NativePHP project using version 1. Then, follow the upgrade guide to upgrade to v2 and run a build for x64 with elevated permissions. Wait, until the build process has completed and try to open the generated EXE file in the console.
Debug Output
(See above)
Which operating systems have you seen this occur on?
Windows
Notes
No response