Skip to content

web app build failing #2

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

Closed
rhodey opened this issue Nov 16, 2020 · 2 comments
Closed

web app build failing #2

rhodey opened this issue Nov 16, 2020 · 2 comments

Comments

@rhodey
Copy link
Owner

rhodey commented Nov 16, 2020

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.

@rhodey
Copy link
Owner Author

rhodey commented Nov 17, 2020

I was able to temporarily workaround the "Cannot find module ./crypto_auth" bug by pinning hypercore's hypercore-crypto dependency to v2.1.0:

b05f650#diff-b861012a5dd72b8a9f3281b7cf09f5a779c98569d040b1bbc1db50f1b15e7cceR22

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:

  1. bankai with babel-plugin-transform-object-rest-spread?
  2. bankai not respecting "browser" tag?

@rhodey
Copy link
Owner Author

rhodey commented Nov 17, 2020

abandoned bankai for browserify + watchify, web app building again.

89327d1

@rhodey rhodey closed this as completed Nov 17, 2020
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

1 participant