web3 / web3.js

Collection of comprehensive TypeScript libraries for Interaction with the Ethereum JSON RPC API and utility functions.
https://web3js.org/
Other
19.28k stars 4.94k forks source link

web3@1.2.3 has broken dependencies #3210

Closed dylanseago closed 4 years ago

dylanseago commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

$ node --version
v10.16.3
$ npm --version
6.11.3
cgewecke commented 4 years ago

There's a hotfix for this queued up..

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

cgewecke commented 4 years ago

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.

xellDart commented 4 years ago

Same issue

swkim109 commented 4 years ago

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

nivida commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@nivida removing package-lock helped 👍

nivida commented 4 years ago

@k06a Great! Thanks for your feedback!