-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
'installing native dependencies' dependency not included for all platforms #8528
Comments
Could you share a sample package.json that I could use to setup a test project locally with? |
Minimal reproduction repo here https://github.com/dancarasco/electron-builder-8528 After "npm run build" you should have a universal mac and x64 windows build. The mac app launches successfully on mac, but on Windows, the installer runs fine and then launching the app results in: |
Thank you! This is quite odd indeed, it seems that the windows Expected path:
UPDATE: @dancarasco can you try with v25.1.5 with Quick side note: You can test without installing the app by just running the |
Found the origin of the issue. Basically, electron-rebuild has a hardcoded Opened a PR for electron-rebuild electron/rebuild#1153 |
Updates to latest electron-rebuild that allows passing in `platform` for prebuilt node modules (previous versions of electron-rebuild had hardcoded `process.platform`) Fixes: electron-userland#8528 electron-userland#8426
Released in 25.1.7, please feel free to give it a shot! |
Brilliant, thank you for tackling this! |
I am on an M2 Max Macbook Pro building for universal mac + windows. When running electron-builder --mac --win on electron-builder 25.0.5, 'installing native dependencies' results in a missing native dependency (sqlite3) for the windows build:
The app launches fine on Mac, but fails with a javascript 'cannot find module' error on Windows. When downgrading to electron-builder 24.13.3 'rebuilding native dependencies' is successfully called for the windows build and the app launches successfully on both platforms:
The 25.0.5 build results in a "Cannot find module" javascript error upon app launch on Windows. I am using unpacked version of sqlite3 which requires the native rebuilds. I was struggling to follow the logs from 25.0.5, am unsure whether it isn't building the win x64 module at all, or failing to copy it in at the correct time, as I can see it did an rebuild for x64 but the app cannot launch as it can't find the rebuilt dependency on Windows.
Additionally, the uncaught exception on Windows specifically targets a cannot find module error via a missing file to 'resources\app.asar\node_modules\sqlite3....' even though I've configured this to be unpacked.
Simply rolling electron-builder back to 24.13.3 and running the same build again without any changes results in a successfully built app that can launch with the native dependency on all platforms.
The text was updated successfully, but these errors were encountered: