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

[Bug]: Indirect wrtc dependency of MEW wallet makes it impossible to develop with onboard.js on M1 mac #691

Closed
mmv08 opened this issue Sep 20, 2021 · 10 comments · Fixed by #709
Assignees
Labels
bug Something isn't working

Comments

@mmv08
Copy link
Contributor

mmv08 commented Sep 20, 2021

Current Behavior

yarn add bnc-onboard

fails on an M1 mac

Expected Behavior

The installation doesn't fail

Steps To Reproduce

  1. On a mac with M1
  2. Run yarn add bnc-onboard

Onboard Version

At the moment of writing the latest is 1.34.2

Node Version

14.17.0

What browsers are you seeing the problem on?

No response

Relevant log output

error /Users/mmv/projects/gnosis/safe-react/node_modules/wrtc: Command failed.
Exit code: 1
Command: node scripts/download-prebuilt.js
Arguments:
Directory: /Users/mmv/projects/gnosis/safe-react/node_modules/wrtc
Output:
404 status code downloading tarball https://node-webrtc.s3.amazonaws.com/wrtc/v0.4.7/Release/darwin-arm64.tar.gz
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.13.0
node-pre-gyp info using node@14.17.0 | darwin | arm64
node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp info check checked for "/Users/mmv/projects/gnosis/safe-react/node_modules/wrtc/build/Release/wrtc.node" (not found)
node-pre-gyp http GET https://node-webrtc.s3.amazonaws.com/wrtc/v0.4.7/Release/darwin-arm64.tar.gz
node-pre-gyp http 404 https://node-webrtc.s3.amazonaws.com/wrtc/v0.4.7/Release/darwin-arm64.tar.gz
node-pre-gyp ERR! install error
node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://node-webrtc.s3.amazonaws.com/wrtc/v0.4.7/Release/darwin-arm64.tar.gz
node-pre-gyp ERR! stack     at Request.<anonymous> (/Users/mmv/projects/gnosis/safe-react/node_modules/node-pre-gyp/lib/install.js:149:27)
node-pre-gyp ERR! stack     at Request.emit (events.js:388:22)
node-pre-gyp ERR! stack     at Request.onRequestResponse (/Users/mmv/projects/gnosis/safe-react/node_modules/request/request.js:1059:10)
node-pre-gyp ERR! stack     at ClientRequest.emit (events.js:376:20)
node-pre-gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:647:27)
node-pre-gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
node-pre-gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:515:22)
node-pre-gyp ERR! stack     at TLSSocket.emit (events.js:376:20)
node-pre-gyp ERR! stack     at addChunk (internal/streams/readable.js:309:12)
node-pre-gyp ERR! stack     at readableAddChunk (internal/streams/readable.js:284:9)
node-pre-gyp ERR! System Darwin 20.6.0
node-pre-gyp ERR! command "/Users/mmv/.nvm/versions/node/v14.17.0/bin/node" "/Users/mmv/projects/gnosis/safe-react/node_modules/wrtc/node_modules/.bin/node-pre-gyp" "install"
node-pre-gyp ERR! cwd /Users/mmv/projects/gnosis/safe-react/node_modules/wrtc
node-pre-gyp ERR! node -v v14.17.0



~/p/g/safe-react feature/safe-apps-search ❯ yarn why wrtc
yarn why v1.22.10
[1/4] 🤔  Why do we have the module "wrtc"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "wrtc@0.4.7"
info Reasons this module exists
   - "bnc-onboard#@myetherwallet#mewconnect-web-client" depends on it
   - Hoisted from "bnc-onboard#@myetherwallet#mewconnect-web-client#wrtc"
info Disk size without dependencies: "168KB"
info Disk size with unique dependencies: "528KB"
info Disk size with transitive dependencies: "4.53MB"
info Number of shared dependencies: 47
✨  Done in 0.64s.

Anything else?

https://github.com/MyEtherWallet/MEWconnect-web-client/blob/master/package.json#L64

@mmv08 mmv08 added the bug Something isn't working label Sep 20, 2021
@davidcallanan
Copy link

This is similar to my issue which is for Windows rather than Mac:
#696

@mmv08
Copy link
Contributor Author

mmv08 commented Sep 25, 2021

@davidcallanan, the errors are different. I think yours is solvable by configuring your environment, e.g., https://stackoverflow.com/questions/39674390/error-with-npm-install-a-pre-gyp-error

@Elyx0
Copy link

Elyx0 commented Sep 25, 2021

It could be the same error. bnc-onboard 1.34.2 starts to embed the wrtc .node (which is a binary file) from the path is bnc-onboard -> myEtherWallet -> wrtc (which ruins Gatsby builds/deploys as well) so we're rolling back to 1.34.1

Generally packages are setup to not load binary files into the browser (as it doesn't work)...

@taylorjdawson
Copy link
Contributor

@Elyx0 @mikheevm We are looking to move MEW wallet as an optional dep that way you can ignore with the flag --ignore-optional. Looks like the only other option would be to drop support for MEW entirely. I have raised an issue in their repo so maybe they could resolve this. Open to suggestions as well 👍🏾

@jamesmorgan
Copy link

Also seeing this on M1s - would be great to get this fixed. 🙏🏻

@amlcodes
Copy link

amlcodes commented Oct 7, 2021

+1 need a fix for m1 - it looks like #709 was merged but wasn't tested? Still having issues installing with and without --ignore-optional

@jamesmorgan
Copy link

Ye its not working for anyone with an M! for us atm as well - last version which builds 1.34.1 - moving beyond this means we can build onboard atm

@mmv08
Copy link
Contributor Author

mmv08 commented Oct 11, 2021

It works for me on M1 and 1.35.1

By "works," I mean the installation still succeeds and doesn't exit with code 1, which was the case before the fix

@piesrtasty
Copy link

Still not working on M1 can this please be reopened?

@piesrtasty
Copy link

I still keep getting

#20 27.92 ModuleNotFoundError: Module not found: Error: Can't resolve '@myetherwallet/mewconnect-web-client' in '/app/node_modules/bnc-onboard/dist/esm' 

despite installing npm install bnc-onboard@1.35.1 --ignore-optional

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants