Skip to content

Production build failing on **macOS**: Missing core JavaScript dependencies #83

@itskawsar

Description

@itskawsar

What were you trying to do?

I am successfully building my application for macOS (Apple Silicon).

What happened?

But the resulting .app fails to launch, throwing a series of ERR_MODULE_NOT_FOUND JavaScript errors.

How to reproduce the bug

  1. Run php artisan native:build mac (or npm run release).
  2. Open the generated .app from the dist folder.
  3. The app crashes immediately with a "JavaScript error occurred in the main process" dialog.

Debug Output

Uncaught Exception: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'electron-store' imported from /Applications/WShipERP.app/Contents/Resources/app.asar/vendor/nativephp/desktop/resources/electron/electron-plugin/dist/server/state.js

I have been manually installing missing packages one by one to get past previous errors. So far, the build has complained about the following missing dependencies:

  • electron-store
  • electron-updater
  • kill-sync
  • ps-node
  • @electron-toolkit/utils
  • @electron/remote
  • fix-path

It seems like these core bridge dependencies are not being bundled into the app.asar automatically, or they are missing from the nativephp/desktop requirements.

Image

Which operating systems have you seen this occur on?

macOS

Notes

Environment

  • NativePHP Version: 2.1.0
  • PHP Version: 8.4 (via Laravel Herd)
  • OS: macOS (ARM64)
  • Electron: ^31.0.0
  • Electron Builder: ^24.13.0

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