ssbc / chloride

MIT License
90 stars 17 forks source link

doesn't work in browser #12

Closed ahdinosaur closed 5 years ago

ahdinosaur commented 5 years ago

moving https://github.com/ssbc/ssb-keys/issues/57 to here

What doesn't work is node-gyp-build.

That is the error

ERROR in ./node_modules/node-gyp-build/index.js
Module not found: Error: Can't resolve 'fs' in '/projects/insta/instagram/node_modules/node-gyp-build'

As i investigated that angular doesn't support fs anymore, I wondered any way around?

/cc @helxsz

ahdinosaur commented 5 years ago

@helxsz: node-gyp-build is used by sodium-native, which is not meant to be used by browsers. the problem is that we should never be require-ing sodium-native from the browser (bundler), as in we shouldn't be running chloride/index.js at all, we should go directly to chloride/browser.js.

dominictarr commented 5 years ago

@helxsz said it does work with latest angular: https://github.com/auditdrivencrypto/private-box/issues/11#issuecomment-493997590

ahdinosaur commented 5 years ago

sweet, closing! :smile_cat:

will keep #13 open, as to me that still makes sense to merge, but keen for feedbacks. :heart: