-
-
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
Failed to Parse Native Modules #334
Comments
Try adding node-loader to the main process webpack config by setting your module.exports = {
pluginOptions: {
electronBuilder: {
chainWebpackMainProcess: config => {
config.module.rule('node').test(/\.node$/).use('node-loader')
},
}
}
} The |
Thanks, I tried adding node-loader and then adjusting the vue.config.js and it got this error.
|
For people who have this same problem, what did work to make the .node file load was using this:
But I am not sure if this is standard and there is any other more 'correct' approach. Thanks for all the help. |
Did you install the |
Sorry for the late reply, yes I did add that but it didn't seem to help. |
Using non webpack require should be fine, but I'm not sure it'd work in a build. |
Thanks, we made the non_webpack_require work in a build We did something like
|
This works for me so far:
|
I have a very simple vue CLI 3 based sample project which I added vue-cli-plugin-electron builder to. Everything starts up correctly. Then I proceeded to add a simple nAPI native module which I compiled fine. I used the instructions here.
I added the following to a simple background.js
If I run
I get
I have tried a variety of things including adding a vue.config.js as mentioned in your documentation to add it as an external.
Can you please let me know what configuration I am missing?
It looks like from what I could tell webpack trying to do something with the binary C++ dll and failing. But from what I have read in your documentation it appears that this native module support should work. Any points would be helpful.
The text was updated successfully, but these errors were encountered: