Hi, I have installed moralis to my angular project (npm i moralis) and imported moralis into the component just like it is done in the demo app " https://github.com/MoralisWeb3/demo-apps/tree/main/moralis-angular-app ". the demo app compile with a warning and still run:
âWarning: C:\Development\demo-apps-main\moralis-angular-app\src\app\app.component.ts depends on âmoralisâ. CommonJS or AMD dependencies can cause optimization bailouts.â
In my angular app I get multiple build errors of dependencies that could not be found, but it is in the node_modules folder.
below is the list of errors and warnings I get in my project:
-
WARNING in ./node_modules/crypto-js/core.js
Module not found: Error: Canât resolve âcryptoâ in âC:\Development\moralis-test\node_modules\crypto-jsâ -
WARNING in C:\Development\moralis-test\src\app\app.component.ts depends on âmoralisâ. CommonJS or AMD dependencies can cause optimization bailouts.
-
WARNING in C:\Development\moralis-test\node_modules@ethersproject\signing-key\lib.esm\elliptic.js depends on âhash.jsâ. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies -
ERROR in ./node_modules/eth-lib/lib/bytes.js
Module not found: Error: Canât resolve âcryptoâ in âC:\Development\moralis-test\node_modules\eth-lib\libâ -
ERROR in ./node_modules/web3-eth-accounts/lib/index.js
Module not found: Error: Canât resolve âcryptoâ in âC:\Development\moralis-test\node_modules\web3-eth-accounts\libâ -
ERROR in ./node_modules/web3-eth-accounts/node_modules/eth-lib/lib/bytes.js
Module not found: Error: Canât resolve âcryptoâ in âC:\Development\moralis-test\node_modules\web3-eth-accounts\node_modules\eth-lib\libâ -
ERROR in ./node_modules/web3-providers-http/lib/index.js
Module not found: Error: Canât resolve âhttpâ in âC:\Development\moralis-test\node_modules\web3-providers-http\libâ -
ERROR in ./node_modules/xhr2-cookies/dist/xml-http-request.js
Module not found: Error: Canât resolve âhttpâ in âC:\Development\moralis-test\node_modules\xhr2-cookies\distâ -
ERROR in ./node_modules/web3-providers-http/lib/index.js
Module not found: Error: Canât resolve âhttpsâ in âC:\Development\moralis-test\node_modules\web3-providers-http\libâ -
ERROR in ./node_modules/xhr2-cookies/dist/xml-http-request.js
Module not found: Error: Canât resolve âhttpsâ in âC:\Development\moralis-test\node_modules\xhr2-cookies\distâ -
ERROR in ./node_modules/xhr2-cookies/dist/xml-http-request.js
Module not found: Error: Canât resolve âosâ in âC:\Development\moralis-test\node_modules\xhr2-cookies\distâ -
ERROR in ./node_modules/cipher-base/index.js
Module not found: Error: Canât resolve âstreamâ in âC:\Development\moralis-test\node_modules\cipher-baseâ -
ERROR in ./node_modules/keccak/lib/api/shake.js
Module not found: Error: Canât resolve âstreamâ in âC:\Development\moralis-test\node_modules\keccak\lib\apiâ -
ERROR in ./node_modules/keccak/lib/api/keccak.js
Module not found: Error: Canât resolve âstreamâ in âC:\Development\moralis-test\node_modules\keccak\lib\apiâ