-
-
Notifications
You must be signed in to change notification settings - Fork 281
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
Dynamic import of native addons #685
Comments
You will want to place your |
Thank you very much for your answer. But this still doesn't seem to work for me, i get this error:
Path must be incorrect, since app.asar is not a directory. Code i used:
For webpack loader i'm using:
And i've put addon.node in public directory. Do you see anything i could be doing wrong? Thank you |
Looks like this is a duplicate of #334. Try the solution that worked there and see if that helps. |
Thank you very much for you help! With the solution you linked, i could make it work like this:
I used os.platform since addon is compiled for each OS. And i still ended up using extraResources as mentioned before, without webpack node loader. This probably isn't the best way to go about it but it was the only way i could make it work. So, just posting my solution, as it might help someone else, maybe. Thanks again. Cheers |
Just a heads up, |
Oh, ok. Thank you for the heads up, i'll fix it. |
I use
|
Hi, i'm not sure this is the place to ask this, but i didn't know where else to do it.
I'm trying to require native node module in my Electron main process. This works fine on development where path is static:
But when i package production build, my path isn't static anymore, since it differs by OS. So i must use dynamic path like this:
When i run this packaged app i keep getting error:
Also, i'm using extraResources to move my addon to Resources folder when packaging.
I tried different workarounds, i also tried native-ext-loader and node-loader for webpack but it doesn't seem to help.
Any help would be greatly appreciated. Thank you.
The text was updated successfully, but these errors were encountered: