electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.69k stars 1.74k forks source link

Troubles with a packaged app with native module dep #4387

Closed warpdesign closed 4 years ago

warpdesign commented 5 years ago

I'm having troubles packaging an Electron app that has a native dependency.

Here is my config object:

    "build": {
        "productName": "React-Explorer",
        "appId": "reactexplorer",
        "mac": {
            "gatekeeperAssess": false,
            "darkModeSupport": true,
            "icon": "icon.icns"
        },
        "win": {
            "icon": "icon.ico"
        },
        "linux": {
            "synopsis": "React-based FileManager",
            "description": "Plugin-based file explorer written with React",
            "category": "FileManager",
            "target": [
                "deb",
                "AppImage"
            ]
        },
        "files": [
            "build/**/*"
        ]
    }

The .app and .dmg are generated but when running the app, coding using the native module crashes with the following error:

gui.js:96 Uncaught (in promise) TypeError: Cannot read property 'indexOf' of undefined
    at Function.t.getFileName (gui.js:96)
    at t (gui.js:96)
    at Promise (gui.js:96)
    at new Promise (<anonymous>)
    at Object.<anonymous> (gui.js:96)
    at Generator.next (<anonymous>)
    at gui.js:96
    at new Promise (<anonymous>)
    at r (gui.js:96)
    at Object.t.list (gui.js:96)

This crashes in the binding module which is supposed to help locate .node binaries.

Here is the build log:

  • electron-builder  version=21.2.0 os=19.0.0
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist/builder-effective-config.yaml
  • rebuilding native dependencies  dependencies=drivelist@8.0.7 platform=darwin arch=x64
  • install prebuilt binary  name=drivelist version=8.0.7 platform=darwin arch=x64
  • build native dependency from sources  name=drivelist
                                          version=8.0.7
                                          platform=darwin
                                          arch=x64
                                          reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
                                          error=prebuild-install info begin Prebuild-install version 5.3.2
    prebuild-install WARN install prebuilt binaries enforced with --force!
    prebuild-install WARN install prebuilt binaries may be out of date!
    prebuild-install info looking for cached prebuild @ /Users/leo/.npm/_prebuilds/1987e2-drivelist-v8.0.7-electron-v64-darwin-x64.tar.gz
    prebuild-install http request GET https://github.com/balena-io-modules/drivelist/releases/download/v8.0.7/drivelist-v8.0.7-electron-v64-darwin-x64.tar.gz
    prebuild-install http 404 https://github.com/balena-io-modules/drivelist/releases/download/v8.0.7/drivelist-v8.0.7-electron-v64-darwin-x64.tar.gz
    prebuild-install WARN install No prebuilt binaries found (target=3.1.13 runtime=electron arch=x64 libc= platform=darwin)

  • packaging       platform=darwin arch=x64 electron=3.1.13 appOutDir=dist/mac
  • signing         file=dist/mac/React-Explorer.app identityName=Apple Development: ****** identityHash=******* provisioningProfile=none
  • building        target=macOS zip arch=x64 file=dist/React-Explorer-2.1.1-mac.zip
  • building        target=DMG arch=x64 file=dist/React-Explorer-2.1.1.dmg
  • building block map  blockMapFile=dist/React-Explorer-2.1.1.dmg.blockmap
  • building embedded block map  file=dist/React-Explorer-2.1.1-mac.zip
stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.