electron-builder
electron-builder copied to clipboard
Cannot find module '@resvg/resvg-js-darwin-arm64' when compiling universal app
- Electron-Builder Version: last
- Node Version: 16
- Electron Version:
- 17.4
- Electron Type (current, beta, nightly):
- Target: mac os universal
I am using resvg library that offers binaries for all OSes including m1 arm64, the problem is that electron builder is not detecting the library when I am compiling the app for universal architecture and only include the library x64 version in the ASAR, the result when I test the app on m1 mac is that library is missing.
> [email protected] pack:mac
> electron-builder --mac
• electron-builder version=23.0.9 os=21.5.0
• loaded configuration file=/Users/julianacaromoreno/projects/streamline-web/electron-builder.yml
• writing effective config file=dist/builder-effective-config.yaml
• packaging platform=darwin arch=arm64 electron=17.4.6 appOutDir=dist/mac-arm64
• signing file=dist/mac-arm64/Streamline.app identityName=Developer ID Application: Webalys, LLC (U7XNJG59LL) identityHash=D67BA83C59353EA2BB7501103EB25119DCBDF921 provisioningProfile=none
• building target=macOS zip arch=arm64 file=dist/Streamline.zip
• building target=DMG arch=arm64 file=dist/Streamline.dmg
• building block map blockMapFile=dist/Streamline.zip.blockmap
How can I force electron builder to download the arm64 binary of the library ?
- This is the content of the unpacked resources
Hey, Try the solution I just posted on another similar issue: https://github.com/electron-userland/electron-builder/issues/6928#issuecomment-1146870701
Same result @burgil
see https://github.com/yisibl/resvg-js/issues/153
Fixed with this, the solution is to exclude C/C++ Files from the asar pack In my case:
...
"files": [
"!node_modules/**/*.{mk,a,o,h}"
],
...