Closed RangerMauve closed 4 years ago
Could it have something to do with caching? There's a build that runs first for running tests.
Not sure how this happens. We have multiple electron apps using sodium-native and noise-protocol without issue
I was thinking caching too, but I don’t know enough about how it works. Worth trying with the cache disabled
@emilbayes Do you think you could point me to a working CI build script by any chance? 😅 I'm gonna be testing removing node_modules from my cache for my next release to see if it helps.
Nothing public but one thing of note is that we do have a build step with browserifg —node
in there and some stuff messing with base path
Ha ha, running into this again and I have no clue how I solved it before. 😂
This time with webpack in the mix to make life harder for me
In case someone runs into this (probably me in the future), I needed to move all the dependencies that depended on sodium-native into the app/package.json
instead of /package.json
in the react electron boilerplate we were using.
Haha thanks! Makes sense, you can’t “bundle” a native module into a single file
you can’t “bundle” a native module into a single file
That's good to know! Would this be true for Browserify too? :thinking:
I'm wondering how we use this in the browser then :thinking:
@DougAnderson444 For browsers you should be using sodium-universal that uses sodium-javascript when you're in a browser environment.
I'm getting reports on Windows and Linux that folks are getting an error that says
Cannot find module ...../app.asar/node_modules/sodium-native/index.js
.This doesn't seem to happen when people build from source and is only happening through automated builds on Travis in a Mac OS environment using electron-builder.
Here's a thread with the issues: https://github.com/RangerMauve/agregore-browser/issues/5#issuecomment-663985709
Seems to be originating from noise-protocol inside hypercore protocol.
I don't think I'm doing anything fancy in the setup in my travis script. It's running
electron-builder build
to compile the binary after annpm install
.Is there something I could look for to see why
index.js
wouldn't be available?