-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Error loading native node module after upgrading from 0.6.0 to 1.0.2 #37
Comments
Can you create simple reproducible test repo? |
Sure. Here is a test repo: https://github.com/pdehne/node-loader-test To reproduce please open a console in the project folder of the repo and run:
Then open a second console in the main project folder and run: You will see the error message in the Electron console window: Stop both npm processes using CTRL-c then change node-loader versions:
Start watch / start:watch in their respective consoles again. The native node module is loaded successfully and you will see "Hello World from Node.js" in the Electron console: |
Weird, using:
still have the problem:
Maybe something buggy with cpp code? |
Did you run npm run configureaddon / npm run buildaddon? The repo targets Electron 10.1.1 and will only build the addon using the right target version if you use these commands. |
Yes Can you try other version of |
I upgraded the repo to Electron 11.3.0. I also streamlined the installation process to show first that it is working with 0.6.0. Please clone the repo into a new folder then run:
Open a second console and run
You should see "Hello World from Node.js" in the Electron console, just like in the screenshot above. If this works please first abort the two npm commands. Then, in one of the consoles run:
And again run npm run watch / npm run start:watch in the two consoles. You should see the error message from the screenshot above. Can you reproduce? |
Thanks, I will look at this in near future |
Problem here:
We contact them so you just have invalid path. But here two weird things - Just interesting why you need this loader, because you can replace this loader using: try {
process.dlopen(module, path.resolve(__dirname, './path/to/file.ext'));
} catch (error) {
// logging
} To be honestly we should deprecate it in favor simple code above |
|
Expected Behavior
I am using a custom native node module in my Electron application. When using node-loader 0.6.0 it is loading fine. When using node-loader 1.0.2 with the very same node module (no recompilation) I get an error.
Actual Behavior
The error thrown is:
soniccore.node:5 Uncaught Error: node-loader:
Error: Invalid package C:\d\sw\trunk\SonicCare\node_modules\electron\dist\resources\electron.asar
at Object../build/Release/soniccore.node (soniccore.node:5)
Code
The text was updated successfully, but these errors were encountered: