MoralisWeb3 / issue-tracker

25 stars 7 forks source link

Cannot add moralis as a dependency in Angular #43

Closed gretzke closed 3 years ago

gretzke commented 3 years ago

Installing Moralis via NPM in an Angular application results in getting these error messages when starting the application:

Error: ./node_modules/@elrondnetwork/bls-wasm/bls.js
Module not found: Error: Can't resolve 'crypto' in 'node_modules/@elrondnetwork/bls-wasm'

Error: ./node_modules/@elrondnetwork/erdjs/out/walletcore/userWallet.js
Module not found: Error: Can't resolve 'crypto' in 'node_modules/@elrondnetwork/erdjs/out/walletcore'

Error: ./node_modules/eth-lib/lib/bytes.js
Module not found: Error: Can't resolve 'crypto' in 'node_modules/eth-lib/lib'

Error: ./node_modules/scryptsy/lib/scrypt.js
Module not found: Error: Can't resolve 'crypto' in 'node_modules/scryptsy/lib'

Error: ./node_modules/scryptsy/lib/scryptSync.js
Module not found: Error: Can't resolve 'crypto' in 'node_modules/scryptsy/lib'

Error: ./node_modules/scryptsy/lib/utils.js
Module not found: Error: Can't resolve 'crypto' in 'node_modules/scryptsy/lib'

Error: ./node_modules/web3-eth-accounts/lib/index.js
Module not found: Error: Can't resolve 'crypto' in 'node_modules/web3-eth-accounts/lib'

Error: ./node_modules/web3-eth-accounts/node_modules/eth-lib/lib/bytes.js
Module not found: Error: Can't resolve 'crypto' in 'node_modules/web3-eth-accounts/node_modules/eth-lib/lib'

Error: ./node_modules/@elrondnetwork/bls-wasm/bls_c.js
Module not found: Error: Can't resolve 'fs' in 'node_modules/@elrondnetwork/bls-wasm'

Error: ./node_modules/@elrondnetwork/erdjs/out/smartcontracts/code.js
Module not found: Error: Can't resolve 'fs' in 'node_modules/@elrondnetwork/erdjs/out/smartcontracts'

Error: ./node_modules/@elrondnetwork/erdjs/out/smartcontracts/typesystem/abiRegistry.js
Module not found: Error: Can't resolve 'fs' in 'node_modules/@elrondnetwork/erdjs/out/smartcontracts/typesystem'

Error: ./node_modules/web3-providers-http/lib/index.js
Module not found: Error: Can't resolve 'http' in 'node_modules/web3-providers-http/lib'

Error: ./node_modules/xhr2-cookies/dist/xml-http-request.js
Module not found: Error: Can't resolve 'http' in 'node_modules/xhr2-cookies/dist'

Error: ./node_modules/web3-providers-http/lib/index.js
Module not found: Error: Can't resolve 'https' in 'node_modules/web3-providers-http/lib'

Error: ./node_modules/xhr2-cookies/dist/xml-http-request.js
Module not found: Error: Can't resolve 'https' in 'node_modules/xhr2-cookies/dist'

Error: ./node_modules/xhr2-cookies/dist/xml-http-request.js
Module not found: Error: Can't resolve 'os' in 'node_modules/xhr2-cookies/dist'

Error: ./node_modules/@elrondnetwork/bls-wasm/bls.js
Module not found: Error: Can't resolve 'path' in 'node_modules/@elrondnetwork/bls-wasm'

Error: ./node_modules/@elrondnetwork/bls-wasm/bls_c.js
Module not found: Error: Can't resolve 'path' in 'node_modules/@elrondnetwork/bls-wasm'

Error: ./node_modules/cipher-base/index.js
Module not found: Error: Can't resolve 'stream' in 'node_modules/cipher-base'

Error: ./node_modules/keccak/lib/api/keccak.js
Module not found: Error: Can't resolve 'stream' in 'node_modules/keccak/lib/api'

Error: ./node_modules/keccak/lib/api/shake.js
Module not found: Error: Can't resolve 'stream' in 'node_modules/keccak/lib/api'
gretzke commented 3 years ago

Run this script after npm install to fix it https://github.com/MoralisWeb3/demo-apps/blob/main/moralis-angular-app/patch.js