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

web3@1.2.3 has broken dependencies #3210

Closed
dylanseago opened this issue Nov 14, 2019 · 12 comments · Fixed by #3211
Closed

web3@1.2.3 has broken dependencies #3210

dylanseago opened this issue Nov 14, 2019 · 12 comments · Fixed by #3211
Labels
1.x 1.0 related issues

Comments

@dylanseago
Copy link

It appears that two packages have been changed to use the @web3-js scope but the corresponding imports weren't updated.

  1. web3-eth-accounts requires scrypt-shim in index.js but in package.json depends on @web3-js/scrypt-shim
  2. web-providers-ws requires websocket in index.js but package.json depends on @web3-js/websocket

Build error emitted by our webpack:

ERROR in ./node_modules/web3-eth-accounts/src/index.js
Module not found: Error: Can't resolve 'scrypt-shim' in '/Users/dylan/dev/ba/faast-web/node_modules/web3-eth-accounts/src'
 @ ./node_modules/web3-eth-accounts/src/index.js 34:13-35
 @ ./node_modules/web3-eth/src/index.js
 @ ./node_modules/web3/src/index.js
[...]

ERROR in ./node_modules/web3-providers-ws/src/index.js
Module not found: Error: Can't resolve 'websocket' in '/Users/dylan/dev/ba/faast-web/node_modules/web3-providers-ws/src'
  @ ./node_modules/web3-providers-ws/src/index.js 27:9-29
  @ ./node_modules/web3-core-requestmanager/src/index.js
  @ ./node_modules/web3-core/src/index.js
  @ ./node_modules/web3-eth-personal/src/index.js
  @ ./node_modules/web3/src/index.js
[...]

Steps to reproduce the behavior

git clone git@github.com:go-faast/faast-web.git
cd faast-web
git checkout web3-v123-issue
npm install
npm run build:app

Versions

Node v12.13.0
npm v6.13.0
web3.js v1.2.3

@pubkey
Copy link

pubkey commented Nov 14, 2019

Same problem here.
Cannot find module 'websocket'
I think web3js should fix that on the CI since it looks like each few releases break stuff.
On my projects I use dependency-check which would have prevented this error.

@nventuro
Copy link

Also getting errors due to scrypt-shym not being installed.

$ node --version
v10.16.3
$ npm --version
6.11.3

@cgewecke
Copy link
Collaborator

There's a hotfix for this queued up..

@pubkey Have added dependency-check to CI per your suggestion, thanks for that idea.

@cgewecke cgewecke reopened this Nov 15, 2019
@cgewecke
Copy link
Collaborator

cgewecke commented Nov 15, 2019

NB: This was auto-closed by GitHub...fixes are not published yet.

Leaving a couple autopsy notes - very disappointed the existing tests did not catch this.

  • The removed/renamed packages are themselves deps in a development dependency so they continued to be installed and resolve in CI.
  • There is a flaw in the way the new publication test works. It publishes Web3 to a virtual npm registry, clones another project, updates their web3 and runs their tests. This happens after the regular clone/install sequence which means there isn't perfect dependency isolation - require is able to resolve outwards until it fails.

@xellDart
Copy link

Same issue

@swkim109
Copy link

swkim109 commented Nov 15, 2019

Same here when installing drizzle library
node -v 12.13.0
npm -v 6.12.0

@nivida nivida added 1.x 1.0 related issues dependencies labels Nov 15, 2019
@nivida nivida mentioned this issue Nov 15, 2019
10 tasks
@nivida
Copy link
Contributor

nivida commented Nov 15, 2019

I apologize for all the trouble you all probably had. We have just released a fix with version 1.2.4 of web3.js.

https://github.com/ethereum/web3.js/releases/tag/v1.2.4

@npomfret
Copy link

npomfret commented Nov 18, 2019

not working for me still after a full rm -rf node_modules && yarn install

Failed to compile.

./node_modules/web3-eth-accounts/src/index.js
Module not found: Can't resolve 'scrypt-shim' in 'node_modules/web3-eth-accounts/src'
$ node -v
v10.13.0
$ npm -v
6.11.3
$ npm ls | grep web3

└─┬ web3@1.2.4
  ├─┬ web3-bzz@1.2.4
  ├─┬ web3-core@1.2.4
  │ ├─┬ web3-core-helpers@1.2.4
  │ │ ├── web3-eth-iban@1.2.4 deduped
  │ │ └── web3-utils@1.2.4 deduped
  │ ├─┬ web3-core-method@1.2.4
  │ │ ├── web3-core-helpers@1.2.4 deduped
  │ │ ├─┬ web3-core-promievent@1.2.4
  │ │ ├── web3-core-subscriptions@1.2.4 deduped
  │ │ └── web3-utils@1.2.4 deduped
  │ ├─┬ web3-core-requestmanager@1.2.4
  │ │ ├── web3-core-helpers@1.2.4 deduped
  │ │ ├─┬ web3-providers-http@1.2.4
  │ │ │ ├── web3-core-helpers@1.2.4 deduped
  │ │ ├─┬ web3-providers-ipc@1.2.4
  │ │ │ └── web3-core-helpers@1.2.4 deduped
  │ │ └─┬ web3-providers-ws@1.2.4
  │ │   ├─┬ @web3-js/websocket@1.0.30
  │ │   └── web3-core-helpers@1.2.4 deduped
  │ └── web3-utils@1.2.4 deduped
  ├─┬ web3-eth@1.2.4
  │ ├── web3-core@1.2.4 deduped
  │ ├── web3-core-helpers@1.2.4 deduped
  │ ├── web3-core-method@1.2.4 deduped
  │ ├─┬ web3-core-subscriptions@1.2.4
  │ │ └── web3-core-helpers@1.2.4 deduped
  │ ├─┬ web3-eth-abi@1.2.4
  │ │ └── web3-utils@1.2.4 deduped
  │ ├─┬ web3-eth-accounts@1.2.4
  │ │ ├─┬ @web3-js/scrypt-shim@0.1.0
  │ │ ├── web3-core@1.2.4 deduped
  │ │ ├── web3-core-helpers@1.2.4 deduped
  │ │ ├── web3-core-method@1.2.4 deduped
  │ │ └── web3-utils@1.2.4 deduped
  │ ├─┬ web3-eth-contract@1.2.4
  │ │ ├── web3-core@1.2.4 deduped
  │ │ ├── web3-core-helpers@1.2.4 deduped
  │ │ ├── web3-core-method@1.2.4 deduped
  │ │ ├── web3-core-promievent@1.2.4 deduped
  │ │ ├── web3-core-subscriptions@1.2.4 deduped
  │ │ ├── web3-eth-abi@1.2.4 deduped
  │ │ └── web3-utils@1.2.4 deduped
  │ ├─┬ web3-eth-ens@1.2.4
  │ │ ├── web3-core@1.2.4 deduped
  │ │ ├── web3-core-helpers@1.2.4 deduped
  │ │ ├── web3-core-promievent@1.2.4 deduped
  │ │ ├── web3-eth-abi@1.2.4 deduped
  │ │ ├── web3-eth-contract@1.2.4 deduped
  │ │ └── web3-utils@1.2.4 deduped
  │ ├─┬ web3-eth-iban@1.2.4
  │ │ └── web3-utils@1.2.4 deduped
  │ ├── web3-eth-personal@1.2.4 deduped
  │ ├── web3-net@1.2.4 deduped
  │ └── web3-utils@1.2.4 deduped
  ├─┬ web3-eth-personal@1.2.4
  │ ├── web3-core@1.2.4 deduped
  │ ├── web3-core-helpers@1.2.4 deduped
  │ ├── web3-core-method@1.2.4 deduped
  │ ├── web3-net@1.2.4 deduped
  │ └── web3-utils@1.2.4 deduped
  ├─┬ web3-net@1.2.4
  │ ├── web3-core@1.2.4 deduped
  │ ├── web3-core-method@1.2.4 deduped
  │ └── web3-utils@1.2.4 deduped
  ├─┬ web3-shh@1.2.4
  │ ├── web3-core@1.2.4 deduped
  │ ├── web3-core-method@1.2.4 deduped
  │ ├── web3-core-subscriptions@1.2.4 deduped
  │ └── web3-net@1.2.4 deduped
  └─┬ web3-utils@1.2.4

@k06a
Copy link

k06a commented Nov 20, 2019

1.2.4 still not works:

npm i
npm WARN deprecated core-js@2.6.10: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/scrypt-shim - Not found
npm ERR! 404 
npm ERR! 404  'scrypt-shim@0.1.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/k06a/.npm/_logs/2019-11-20T08_14_08_163Z-debug.log

@nivida
Copy link
Contributor

nivida commented Nov 20, 2019

This got definitely fixed with 1.2.4. Have you tried to remove your package-lock files and to do a clean install @k06a?

@k06a
Copy link

k06a commented Nov 20, 2019

@nivida removing package-lock helped 👍

@nivida
Copy link
Contributor

nivida commented Nov 20, 2019

@k06a Great! Thanks for your feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.x 1.0 related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants