sentialx / node-window-manager

Manage windows in Windows, macOS and Linux using Node.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash when using the lib on Windows

antholord opened this issue · comments

Bug description
When accessing windowmanager.getActiveWindow(), there is an uncaught exception :

Error: No native build was found for platform=win32 arch=x64 runtime=electron abi=80 uv=1 libc=glibc
at Function.load.path (webpack:///../node-window-manager/node_modules/node-gyp-build/index.js?:57:9)
at load (webpack:///../node-window-manager/node_modules/node-gyp-build/index.js?:22:30)
at eval (webpack:///../node-window-manager/dist/index.js?:23:133)

It has something to do with index.ts line 12. I pulled it locally and tried to change the require path, symlinked it to my electron project, and could not get anything to work. The same error always.

To Reproduce
Import the lib in an electron project running node 12 and the latest major electron version
IMPORTANT NOTE : to get the project to build, I had to change the prebuild command and add my node version :
"prebuild": "prebuildify --napi -t 12.18.0"

This may very well be related to the error, but without this change, the lib wont build.

False alert : I did not specify the lib as an external in the electronBuilder config. That caused the source of my issues. Now that I have done that, everything works fine. Maybe you can add a disclaimer about it somewhere. It might only be because of my specific electron + webpack setup, but I used a pretty popular boilerplate to start,