SnosMe / uiohook-napi

MIT License
162 stars 37 forks source link

Electron No native build was found for platform=win32 #33

Closed DomEscobar closed 5 months ago

DomEscobar commented 9 months ago

Hey im glad this lib exists -

Im on a windows machine and trying to get it running on my electron app. However i get the error :

`Uncaught Error: No native build was found for platform=win32 arch=x64 runtime=electron abi=113 uv=1 libc=glibc node=18.12.1 electron=23.3.10 loaded from: C:\repos\electron-vite-react-express-llm\node_modules\electron\dist\resources\electron.asar

at load.resolve.load.path (node-gyp-build.js:60:9)
at load (node-gyp-build.js:22:30)
at node_modules/uiohook-napi/dist/index.js (index.ts:3:27)
at __require2 (chunk-AUZ3RYOM.js?v=c42660a0:18:50)
at index.ts:270:39`

I tried to add a similar setup like in iohook to my package.json, but it didnt helped:

"uiohook-napi": { "targets": [ "electron-76" ], "platforms": [ "win32", "darwin", "linux" ], "arches": [ "x64", "ia32" ] },

What am i missing here :/

SnosMe commented 9 months ago

You need to correctly setup your build tool.

since vite isn't useful for electron main part, I use underlying esbuild and here is config for inspiration https://github.com/SnosMe/awakened-poe-trade/blob/b446c617cc1d4970067c209cf172a5dd93fcf72a/main/build/script.mjs#L33