joeferner / node-java

Bridge API to connect with existing Java APIs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Loading non-context-aware native module in renderer error in Electron 14+

choiman1559 opened this issue · comments

I am using ubuntu 20.04.4 LTS with nodeJS v16.16.0, electron 19.0.8.

As soon as I run the app, this exception is thrown immediately.

Uncaught Error: Loading non-context-aware native module in renderer: '/home/mydir´/remotesync_desktop/syncprotocol_lib/node_modules/java/build/Release/nodejavabridge_bindings.node'. See https://github.comhttps://github.com/electron/electron/issues/18397" target="_blank" rel="nofollow.
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:5:1812)
    at Module._extensions..node (node:internal/modules/cjs/loader:1203:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:5:1812)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at i._load (node:electron/js2c/renderer_init:33:356)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/mydir/remotesync_desktop/syncprotocol_lib/node_modules/java/lib/nodeJavaBridge.js:21:16)

Electron issue link:
electron/electron#18397

What should I do to solve this?

Is there any other way other than lowering the version of Electron?

I have the same problem too.

node:electron/js2c/renderer_init:73 Error: node-pty failed to load. Typically this means that it was built incorrectly. Please check the readme.md to more info. Error: Loading non-context-aware native module in renderer: '/Users/zcy/Desktop/project/dunHuang/leo-gui/app/node_modules/node-pty/build/Release/pty.node'. See https://github.com/electron/electron/issues/18397.

Have you found a solution?