-
Notifications
You must be signed in to change notification settings - Fork 40
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
Can not find module "uiohook-napi" after installation .exe #43
Comments
I think you need to force electron-forge to exclude uiohook-napi from the ASAR archive for it to work in packaged form. I am doing this using |
Hey @marcelblum, I appreciate your help. Unfortunately, I tried what you suggested, but I'm still encountering the same error 😔. Sharing my forge.config file code for your reference. Could you please review it and let me know if I've made any mistakes? I'm relatively new to Electron, so I apologize in advance for any beginner errors. Thanks again!
|
You can test it by looking in the folder structure of your packaged app to see if the files are outside the ASAR as desired. If successful you should find the excluded files under |
I have tried both
I am using |
if you're not seeing a |
Hello all! I'm having the same issue here: https://github.com/Dygmalab/Bazecor/tree/removeFocusAPI (open software with GPLv3 license so that you can compile it yourselves with yarn make) I found this plugin from Forge to make use of the asar packager, but it fails either way. This only fails in Windows platforms, in Mac it's working perfectly when packed. |
@batoolfatima2135 did you manage to solve the issue on your side? |
so, just for the record, I found the reason. After updating xstate to v5, electron-forge started failing in the packaging process, to solve it, I had to update Typescript package from v4 to v5, but that broke the Windows native package's prebuilt binaries compilation. The issue was within the filter in forge.config.ts at the packageAfterPrune function, and was due to a change in how the RegEx detected the prebuilds path to remove the precompiled binaries from other platforms than the one being compiled, it deleted them all, thus failing to execute when packaged. Changing the filter to look for the platform independently solved this issue and maintained the optimization. |
that's great you found solution @alexpargon, actually on my side I just used vite instead of webpack and it started working |
I am using electron forge with webpack and typescript, uiohook-napi is working properly in my development platform. Compiling the program is also working. But when I tried to install the .exe file this error is appearing.
My enviroment
uiohook-napi Version: ^1.5.3
Environment name and version: nodejs 20.9.0, electron: 29.1.5, electron-forge: ^7.3.1
Operating System and version: win32 x64
The text was updated successfully, but these errors were encountered: