Skip to content
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

Node 16 problems? #326

Closed
mixmix opened this issue Apr 5, 2022 · 5 comments
Closed

Node 16 problems? #326

mixmix opened this issue Apr 5, 2022 · 5 comments

Comments

@mixmix
Copy link
Member

mixmix commented Apr 5, 2022

I was trying to use ssb-db2 in my updated ssb-ahoy launcher, and got this error:

App threw an error during load
Error: No native build was found for platform=linux arch=x64 runtime=electron abi=103 uv=1 libc=glibc node=16.13.2 electron=18.0.1
    loaded from: /home/mix/projects/SSBC/ssb-ahoy/example/node_modules/ssb-validate2-rsjs-node

    at Function.load.path (/home/mix/projects/SSBC/ssb-ahoy/example/node_modules/node-bindgen-loader/index.js:62:9)
    at load (/home/mix/projects/SSBC/ssb-ahoy/example/node_modules/node-bindgen-loader/index.js:27:30)
    at Object.<anonymous> (/home/mix/projects/SSBC/ssb-ahoy/example/node_modules/ssb-validate2-rsjs-node/index.js:5:41)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:829:12)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)

This is the current latest electron which internally runs Node 16.

@mixmix
Copy link
Member Author

mixmix commented Apr 5, 2022

This change fixed it:

const validate2 = require('ssb-validate2')
// const validate2 =
//   typeof localStorage === 'undefined' || localStorage === null
//     ? require('ssb-validate2-rsjs-node')
//     : require('ssb-validate2')
 

@arj03
Copy link
Member

arj03 commented Apr 5, 2022

@mycognosist might now :)

@mycognosist
Copy link
Member

Challenging my memory over here ':)

The code shown in @mixmix's fix is used to determine the runtime environment and pull in the appropriate package (are we running in the browser or in node?).

Now I see that Electron is not currently supported by ssb-validate2-rsjs-node (ssbc/ssb-validate2-rsjs-node#13).

@nichoth
Copy link
Contributor

nichoth commented Apr 5, 2022

I know I had trouble with this part in the past

require('ssb-validate2-rsjs-node')

Something about a rust-based dependency being used on an m1 architecture mac.

Likewise I think I fixed it by changing to the pure node version -- const validate2 = require('ssb-validate2')

@staltz
Copy link
Member

staltz commented Sep 21, 2022

Outdated now with [email protected]

@staltz staltz closed this as completed Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants