Open jpakulski opened 1 year ago
Probably related to: https://github.com/serialport/node-serialport/issues/2463
per https://github.com/serialport/node-serialport/issues/2619 cross building using electron-builder should now work correctly in electron-builder 24.5.1
SerialPort Version
10.4.0
Node Version
16.14.1
Electron Version
20.0.2
Platform
Mac / Docker image based on electronuserland/builder:wine
Architecture
x64
Hardware or chipset of serialport
N/A
What steps will reproduce the bug?
Clone the serial port demo project:
Add electron-builder:
Add electron-builder config to package.json (test config below):
Add the following scripts to package,json:
Execute the following (on Mac or Docker (electronuserland/builder:wine) container): npm i npm run clean npm run dist:win
What happens?
The build seems to work:
But when the app is run on Windows, I get the following error in the dev tools:
I'm sure I'm missing a step or just don't understand how to use/configure the prebuilt versions or how the Node-API versions are supposed to work.
Everything was working in our CI env. (Docker build) before updating to Serialport >= 10.
What should have happened?
We should get a working application as before updating Serialport to version 10+.
Additional information
I tried this with a rainbow of node versions / electron versions / serial port versions all resulting in the same error.
Back in the pre Node-API days this line:
was always followed by:
I guess native dependancies are being built for the wrong platform rather than the prebuilt ones being used. There is an autoDetect function which is supposed to supply the correct bindings but somehow it does not work?
Any help is super appreciated.
Cheers.