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 Error on Different Platforms (serialport & electron) #2720

Open
dkarski opened this issue Oct 20, 2023 · 1 comment
Open

Build Error on Different Platforms (serialport & electron) #2720

dkarski opened this issue Oct 20, 2023 · 1 comment

Comments

@dkarski
Copy link

dkarski commented Oct 20, 2023

SerialPort Version

10.5.0

Node Version

18.16.1

Electron Version

26.4.0

Platform

Darwin MacBook-Pro-Appnroll-3.local 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64 x86_64

Architecture

x86/x64

Hardware or chipset of serialport

No response

What steps will reproduce the bug?

  1. Clone the dkarski:electron-serialport:electron-builder project repository.
  2. Run the application on a Mac system.
  3. Try to build (an application on a Mac system) and run the application on a Windows system.

What happens?

When I try to run the application on a Windows system that has been built on a Mac system, the application behaves incorrectly and displays the following error in the console. However, when I build the application on Windows, it runs without any issues.

Uncaught Error: \\?\C:\Users\Daniel Karski\AppData\Local\Programs\electron-serialport\resources\app.asar.unpacked\node_modules\@serialport\bindings-cpp\build\Release\bindings.node is not a valid Win32 application.
\\?\C:\Users\Daniel Karski\AppData\Local\Programs\electron-serialport\resources\app.asar.unpacked\node_modules\@serialport\bindings-cpp\build\Release\bindings.node

What should have happened?

I would expect the application to work correctly on a Windows system, regardless of the system on which it was built.

Additional information

In my case, I used the electron-builder tool for building the application, but a similar issue occurs when using other tools such as electron-forge with webpack or Vite. It appears that the build tool is not the primary cause of the issue described.

It's important to note that when I build the application on Windows, it runs without any issues. The problem seems to be specific to building the application on a Mac and then running it on Windows.

I would appreciate any assistance in resolving this problem, as it hinders the development and testing of the application on different platforms.

Thank you for your attention and assistance!

@GazHank
Copy link
Contributor

GazHank commented Oct 20, 2023

I'm not sure if electron-builder supports cross build of a windows app from MacOS. The only cross build scenario that I can see in the documentation is building on Linux to target windows https://www.electron.build/multi-platform-build.html#to-build-app-for-windows-on-linux

I wonder if a docker container would let you work around this limitation?

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