-
Notifications
You must be signed in to change notification settings - Fork 26
Addon node module not found in packaged windows version #2
Comments
In my logs when it can't be found it states |
I see in my generated |
Hello, in the meanwhile can you give the dev ( This version requires at least Webpack 2 but looking at your project it should cause no issue, and it re-introduces the use of the loader's API Another idea would be to open you package and look for calls to Regards |
Ok updated to I am using only Question about the functionality of the basePath option: That sets the path to the addon to be relative to the launched executable? I suppose I'm a bit confused by its intent. Cheers for the help! |
Ah after reviewing the webpack built main.js I See:
And the matching |
From what I can see, it keeps emitting the |
So I believe I fixed the issue I was having by adding an explicit directory setting: While not perfect, this seems to properly have the files accessible for the packaged version. I was never able to figure out the reason why my setting of basePath was resulting in So I can leave this issue open for that if you'd like, otherwise you can close. |
I could not make your code work on my Mac, so I could not investigate much, but I made a few changes to the code on
// Load C++ modules
{
test: /\.node$/,
use: [
{
loader: "node-addon-loader",
options: {
// force all modules to be loaded from "XXX/<hash>.node" regardless the context webpack detected
rewritePath: "XXX"
}
},
],
}, So in you case you can force the code to load the module from "resources" with This feature is not yet documented, but you can find it on |
@alexlyp check what is a I'm not a 100% sure why this package doesn't work, but there is something wrong with building a path in the runtime. I'd the same problem when building an electron application and solved it by resolving path in the runtime. In my case, the |
@smt116 the issue might be that an electron app is not a "standard" web app and webpack kinda get confused. For eg. if your build process produces files as follows:
then in a usual web app you make your web server point to btw I am no webpack expert, so I could not figure a better way to handle this issue... Maybe your are right and using |
In my case, all files from the |
Hello @ushu. thank you for your great work. |
I'm currently using
node-addon-loader
to attempt to pull in a C++ node addon into our electron application decrediton. It is currently working while using a hot-loaded dev environment and when running the windows-unpacked version. But after installing the electron-builder windows NSI and running the install .exe it no longer is able to locate the required.node
webpack config:
https://github.com/alexlyp/decrediton/blob/ayp_anotherTry/webpack.config.base.js#L35-L41
require(win32ipc):
https://github.com/alexlyp/decrediton/blob/ayp_anotherTry/app/main.development.js#L306
Any thoughts as to why it isn't working after installing verses windows-unpacked? Any help would be greatly appreciated! Cheers
The text was updated successfully, but these errors were encountered: