-
Notifications
You must be signed in to change notification settings - Fork 280
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
node-hid prebuilds do not work with Electron 4, due to ABI incompatibilities #293
Comments
Hi, |
Verified this on MacOS. Closed issue by accident. |
Yes mac, sorry I thought it was implied by the path, but I guess linux could be the same. sorry! |
btw, thanks for your work on this module, it's great!!!! |
Thanks! It's unfortunate it's such a pain that it seems to always break whenever a new Node or Electron version comes out. Seems the way for native Node modules though. |
Note to self: I think this error message is essentially a Node version mismatch error between command-line Node v10 and the Node v10 inside of Electron. That is, it seems like this is a problem with |
I think I have a work-around fix for this.
and see a list of HID devices, running in an Electron v4.0.0 window. |
Note to self: It seems the main issue is that node-hid@0.7.4 has prebuilt binaries for Node v10 and Electron v3.x, but Node v10 is such a mess wrt native modules that |
@todbot YEP!!! Totally works with my project. So good! |
Current strategy: remove prebuilds for Electron v4. This forces node-hid to be recompiled on Keeping this issue open until a real solution is found. (thx @setpixel for reporting this) |
There seems to be more details on this issue here: electron/node-abi#55 TL;DR: The ABI for both Electron v3 and v4 is 64, but the builds are not compatible (probably because they switched from GYP to GN). |
Thanks for finding that @gniezen! I was going down similar rabbit holes but gave up. Following that issue now though... |
Hi @todbot the implementation in todbot/electron-hid-toy works well for me with my mac builds (packaging and executing). I can also generate a windows build (which I am building on mac), but when I run the .exe that's when I run into problems. It doesn't run on windows and I keep getting an error message on a file in the temp folder which says "this is not a valid win32 application" Could this be something todo with bypassing using prebuilds? |
Hi @adeperio, what version of Windows are you running? |
Hi @todbot, I'm running Win7 64bit and building specifically for that with electron-builder. I also have another native dependency (keytar) so I'm not sure if node-hid is the problem or if its keytar |
Oh wait you are building a Windows executable on Mac? In general that seems to never work well. Try building on Windows |
@todbot Yea I've been building windows on Mac fro a while now. I've only started having problems after upgrading to Electron 4. I'd like to continue building Windows on Mac if possible. I'm not sure where to look for any changes in the compatibility between the upgrade to Electron 4 (from 1.8.6, where node-hid was working with windows being built on mac) to the latest node-hid. Is there anything else you think I could look at? |
@todbot I think I was using the prebuilt binaries before with nodehid, and the build seemed to be working with those. I noticed that prebuilt binaries are not included with nodehid 0.7.9? If that's the case, any idea if they may be coming out any time soon? Or if not, is there a way I can generate those prebuilt binaries myself? |
yeah because of the (although now that I look at that bug, perhaps the problem has been fixed as of a few days ago with Electron 4.0.4 that incorporates this fix: electron/electron#16687 ) I'll do some tests tomorrow. |
@todbot Thanks Tod, I've been following the comments around this ABI issue. Hopefully 4.0.4 has a fix? It would be useful to get new prebuilds with node-hid. If it helps, I was packaging windows up successfully on a mac machine prior to this on Electron 1.8.6 using the node-hid prebuilds. But we're now looking to upgrade from 1.8.6 to 4.0.4 and hence started running into this issue |
system: windows10 |
that looks like a problem with |
Hi @todbot thank you, I actually just saw 0.7.7 come up on the releases page. Will look out for it on npm when it's available there and see if that brings me a step forward on my end |
I believe this is fixed now in |
Thanks @todbot can confirm from my end that 0.7.7 node-hid is now working with Electron 4.0.4! |
Electron 4.0.0 was just released. It is the main release.
Electron 4.0.0 uses node 10.11.0.
It seems to build fine with rebuild, and it works when I require.
However, when I try to call hid.devices(), i get:
The text was updated successfully, but these errors were encountered: