Closed MuhKuh7 closed 1 year ago
We had to transition to the official electron/rebuild package due to newer Electron versions requiring additional compiler flags. I'm wondering if you're running into this issue https://github.com/electron-userland/electron-builder/pull/7465
Can you create a sample repo to reproduce this? I can investigate on it locally.
Can you please try release 24.5.1 and report back if that resolves your issue?
Can you please try release 24.5.1 and report back if that resolves your issue?
Unfortunately still the same with version 24.5.1
Can you please try release 24.5.1 and report back if that resolves your issue?
Unfortunately still the same with version 24.5.1
try 24.5.1 and npmRebuild: true, it's help me
try 24.5.1 and npmRebuild: true, it's help me
doesn't do anything for me
Can you please try 24.6.1? 🤞
Now the build fails ;)
> electron-builder install-app-deps
• electron-builder version=24.6.1
• loaded configuration file=package.json ("build" field)
• loaded parent configuration preset=react-cra
⨯ Cannot read properties of undefined (reading 'value') failedTask=installAppDeps stackTrace=TypeError: Cannot read properties of undefined (reading 'value')
at rebuild (/app/node_modules/app-builder-lib/src/util/yarn.ts:169:49)
at installOrRebuild (/app/node_modules/app-builder-lib/src/util/yarn.ts:29:11)
at installAppDeps (/app/node_modules/electron-builder/src/cli/install-app-deps.ts:58:3)
On it! Will attempt to take a look tonight
Try 24.6.2 🙂
Try 24.6.2 🙂
Seems to work now. Only strange thing is that it reports the platform used as "linux" which is the system it is built on instead of "win32" which it is built for. Since the built application runs under Windows I assume it actually used the correct binaries though.
> electron-builder install-app-deps
• electron-builder version=24.6.2
• loaded configuration file=package.json ("build" field)
• loaded parent configuration preset=react-cra
• rebuilding native dependencies dependencies=keytar@7.9.0 platform=linux arch=x64
• install prebuilt binary name=keytar version=7.9.0 platform=linux arch=x64 napi=
I think prebuild installs all OS version? Not sure.
Can this issue be closed?
I am running into a similar issue trying to cross-build from linux to windows. I have tried finding the problem on and off for quite a while now, but can't figure it out. The problem might very well be the package with a native dependency I use (https://www.npmjs.com/package/@tauubyebye/win-audio).
I just created a very minimal electron app that exhibits the problem: https://github.com/universal/electron-native-dependencies-cross-build
I am still getting familiar with the whole electron/js-ecosystem and have so far no real clue about how native dependencies work. If the problem is in the used package, a pointer to how to fix it there would be very much appreciated.
I also tried building the app through the docker images and based the command in build.sh
off of your example for travis.
If i can help in any way in debugging this I am happy to do/provide whatever you need :-) Your help is very much appreciated.
A little bit further reading indicates that cross-compiling of native dependencies in a package does not really work (as far as i understood it). What should work if precompiled binaries are uploaded to github. The package I use does not have those. I am now trying to figure out how and where to put those.
What should work if precompiled binaries are uploaded to github. The package I use does not have those.
If the package does not have those, then you need to compile the dependencies from the source code, meaning you need a Mac and a Windows build node at minimum. (Mac build node can compile Linux .node
modules)
Cross-compiling native dependencies is not possible.
thanks for your reply :-) that is what i figured as well. figuring out prebuild/prebuildify now... :-)
finally found something that works. could not get prebuildify to work, but something based on prebuild / prebuild-install appears to be working now :-) hopefully i can now ditch the vms with windows. The forked library is at https://github.com/universal/win-audio if you are looking for some inspiration... haven't added any ci-pipelines here.
so this works for me with 24.6.3 :-)
I am building for Windows on a Linux machine. With electron-builder 23 that works fine and I can see that the native dependencies (keytar in my case) are handled.
But when I update to version 24, the application built on Linux does not run on Windows anymore and throws a "not a win32 application" error. When built on Windows it works. From the output I noticed that there is no mention anymore of the native dependencies.