Closed rhodey closed 3 years ago
I was able to temporarily workaround the "Cannot find module ./crypto_auth"
bug by pinning hypercore's hypercore-crypto
dependency to v2.1.0
:
Moving onward I have uncovered two more issues, the first is that I cannot manage to get bankai and babel working together in order to deal with this use of the JavaScript spread operator in hypercore:
opts = { ...opts }
https://github.com/hypercore-protocol/hypercore/blob/master/index.js#L1265
After rewriting that one line to use Object.assign()
the bankai start
command succeeds and I am able to test the web app using localhost 8080, unfortunately bankai build
fails to bundle the app with the following error:
scripts:browserify.bundle Can't walk dependency graph: ENOENT: no such file or directory, lstat '/home/rhodey/dev/dsp/radiowitness/web/worker_threads'
required by /home/rhodey/dev/dsp/radiowitness/web/node_modules/sodium-universal/memory.js
Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/home/rhodey/dev/dsp/radiowitness/web/worker_threads'
required by /home/rhodey/dev/dsp/radiowitness/web/node_modules/sodium-universal/memory.js
This is unexpected because sodium-javascript
appears to be using the package.json
"browser"
tag correctly to omit worker_threads
from browser bundling:
"browser": {
"crypto": false,
"worker_threads": false
}
https://github.com/sodium-friends/sodium-javascript/blob/master/package.json#L28
So, two things to track down:
babel-plugin-transform-object-rest-spread
?"browser"
tag?abandoned bankai for browserify + watchify, web app building again.
https://github.com/rhodey/radiowitness/commit/89327d1dea08228bd138656bacb8ff22a429f9c8
The web app used to be built with bankai which makes use of browserify. sodium-universal has a bug and is a dependency of hypercore and hyperdb.