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

Error after update rxjs v6 #1611

Closed
SShushmintcev opened this issue May 4, 2018 · 5 comments
Closed

Error after update rxjs v6 #1611

SShushmintcev opened this issue May 4, 2018 · 5 comments

Comments

@SShushmintcev
Copy link

SShushmintcev commented May 4, 2018

After update angular and rxjs to v6

ng build

WARNING in ./node_modules/asn1.js/lib/asn1/api.js
Module not found: Error: Can't resolve 'vm' in '******\toh-pt6\node_modules\asn1.js\lib\asn1'

ERROR in ./node_modules/eth-lib/lib/bytes.js
Module not found: Error: Can't resolve 'crypto' in '\toh-pt6\node_modules\eth-lib\lib'
ERROR in ./node_modules/web3-eth-accounts/node_modules/eth-lib/lib/bytes.js
Module not found: Error: Can't resolve 'crypto' in '
\toh-pt6\node_modules\web3-eth-accounts\node_modules\eth-lib\lib'
ERROR in ./node_modules/web3-eth-accounts/src/index.js
Module not found: Error: Can't resolve 'crypto' in '\toh-pt6\node_modules\web3-eth-accounts\src'
ERROR in ./node_modules/browserify-sign/browser/index.js
Module not found: Error: Can't resolve 'stream' in '
\toh-pt6\node_modules\browserify-sign\browser'
ERROR in ./node_modules/cipher-base/index.js
Module not found: Error: Can't resolve 'stream' in '\toh-pt6\node_modules\cipher-base'
ERROR in ./node_modules/hash-base/index.js
Module not found: Error: Can't resolve 'stream' in '
\toh-pt6\node_modules\hash-base'

@Pedro-vk
Copy link

Pedro-vk commented May 9, 2018

I'm having the same problem with similar libraries (like web3-eth-accounts). But I think that the problem comes from Angular upgrade and the webpack configuration.

@kmturley
Copy link

Related issue here:
#1555

Workarounds suggested:

  • downgrade to Angular 5
  • try upgrading NodeJS version which includes crypto
  • download the build files from the releases page, copy the source to app/src and include it on scripts property of the angular.json config

I tried these, and they didn't work for me! From what I understand it's an issue with the typings file. Or a dependency.

My workaround was to downgrade to an older version of web3:
npm install [email protected]

@Pedro-vk
Copy link

Another workaround is the suggested here: angular/angular-cli#1548 (comment)
It replaces the webpack config of @angular/cli

@kmturley
Copy link

The solution with the patch worked for me!
https://gist.github.com/niespodd/1fa82da6f8c901d1c33d2fcbb762947d

node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js
node: {crypto: true, stream: true}

@SShushmintcev
Copy link
Author

@Pedro-vk Thanks. It is working for me

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

3 participants