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

Build fails for electron v26.1 on opening #1060

Closed
coltoneshaw opened this issue Sep 10, 2023 · 3 comments
Closed

Build fails for electron v26.1 on opening #1060

coltoneshaw opened this issue Sep 10, 2023 · 3 comments

Comments

@coltoneshaw
Copy link

Electron: v26.1.0
Electron-builder: v24.6.4
Better-sqlite3: v8.6.0

When attempting to build via electron-builder I get the below error. If I adjust the node-abi version in the rebuild package from 3.3.0 to 3.47.0 it builds it without the failure but the app crashes on opening. I think it could be related to #1044

Build build failure with OG prebuild deps

This fails to build, but the application opens just fine and nothing seems to be wrong.

  • build native dependency from sources  name=better-sqlite3
                                          version=8.6.0
                                          platform=darwin
                                          arch=x64
                                          napi=
                                          reason=prebuild-install failed with error (run with env DEBUG=electron-builder to get more information)
                                          error=/Users/coltonshaw/Desktop/scripts/pcomvp-desktop/node_modules/prebuild-install/node_modules/node-abi/index.js:39
      throw new Error('Could not detect abi for version ' + target + ' and runtime ' + runtime + '.  Updating "node-abi" might help solve this issue if it is a new release of ' + runtime)
      ^
    
    Error: Could not detect abi for version 26.1.0 and runtime electron.  Updating "node-abi" might help solve this issue if it is a new release of electron
        at getAbi (/Users/coltonshaw/Desktop/scripts/pcomvp-desktop/node_modules/prebuild-install/node_modules/node-abi/index.js:39:9)
        at module.exports (/Users/coltonshaw/Desktop/scripts/pcomvp-desktop/node_modules/prebuild-install/rc.js:54:57)
        at Object.<anonymous> (/Users/coltonshaw/Desktop/scripts/pcomvp-desktop/node_modules/prebuild-install/bin.js:8:27)
        at Module._compile (node:internal/modules/cjs/loader:1233:14)
        at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
        at Module.load (node:internal/modules/cjs/loader:1091:32)
        at Module._load (node:internal/modules/cjs/loader:938:12)
        at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
        at node:internal/main/run_main_module:23:47
    
    Node.js v20.5.1

Build success, failure to open

To ensure your native dependencies are always matched electron version, simply add script `"postinstall": "electron-builder install-app-deps" to your `package.json`
  • writing effective config  file=dist/builder-effective-config.yaml
  • rebuilding native dependencies  [email protected] platform=darwin arch=x64
  • install prebuilt binary  name=better-sqlite3 version=8.6.0 platform=darwin arch=x64 napi=
  • packaging       platform=darwin arch=x64 electron=26.2.0 appOutDir=dist/mac
  • downloading     url=https://github.com/electron/electron/releases/download/v26.2.0/electron-v26.2.0-darwin-x64.zip size=94 MB parts=8
  • downloaded      url=https://github.com/electron/electron/releases/download/v26.2.0/electron-v26.2.0-darwin-x64.zip duration=12.383s
  • signing         file=dist/mac/PCO MVP.app identityName=Developer ID Application: Colton Shaw (4UHVHSRL22) identityHash=B22AEB9D9BCF2EAAC4FAD28C290D825A19055CEA provisioningProfile=none
  • building        target=DMG arch=x64 file=dist/pcomvp-desktop-2.1.1-mac-x64.dmg
  • building        target=macOS zip arch=x64 file=dist/pcomvp-desktop-2.1.1-mac-x64.zip
  • Detected arm64 process, HFS+ is unavailable. Creating dmg with APFS - supports Mac OSX 10.12+
  • building block map  blockMapFile=dist/pcomvp-desktop-2.1.1-mac-x64.dmg.blockmap
  • building block map  blockMapFile=dist/pcomvp-desktop-2.1.1-mac-x64.zip.blockmap

Screenshot 2023-09-10 at 10 36 44 AM

@coltoneshaw coltoneshaw changed the title Build fails Build fails for electron v26.1 on opening Sep 10, 2023
@Prinzhorn
Copy link
Contributor

I think it could be related to #1044

It is exactly that. It says " install prebuilt binary name=better-sqlite3 version=8.6.0 platform=darwin arch=x64 napi=" so you've downloaded the broken prebuild. You need to force the package to be compiled for Electron 26 as described in that issue.

@coltoneshaw
Copy link
Author

@Prinzhorn - Awesome, thanks. I didn't think that meant it was the same issue since it always downloads a prebuilt binary. So, effectively everyone on electron v26 is most likely broken? I'll close this and test the other fix though, thank you!

@coltoneshaw coltoneshaw closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2023
@Prinzhorn
Copy link
Contributor

So, effectively everyone on electron v26 is most likely broken?

It looks like it, yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants