add CDN/prebuilt version for angular
See original GitHub issuecurrent import (import WalletConnectProvider from "@walletconnect/web3-provider"
) depends on Node/Commonjs modules like crypto which is not available in browser & angular cli don’t support it, so please add prebuilt CDN version, it is very difficult to integrate with default angular setup with official cli.
Here are the errors shown in angular:
ERROR in ./node_modules/@pedrouid/iso-crypto/dist/cjs/helpers/env/node.js Module not found: Error: Can’t resolve ‘crypto’ in ‘/Users/aks/work/projects/akemona-frontend/node_modules/@pedrouid/iso-crypto/dist/cjs/helpers/env’
ERROR in ./node_modules/xhr2-cookies/dist/xml-http-request.js Module not found: Error: Can’t resolve ‘http’ in ‘/Users/aks/work/projects/akemona-frontend/node_modules/xhr2-cookies/dist’
ERROR in ./node_modules/xhr2-cookies/dist/xml-http-request.js Module not found: Error: Can’t resolve ‘https’ in ‘/Users/aks/work/projects/akemona-frontend/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 ‘/Users/aks/work/projects/akemona-frontend/node_modules/xhr2-cookies/dist’
ERROR in ./node_modules/cipher-base/index.js Module not found: Error: Can’t resolve ‘stream’ in ‘/Users/aks/work/projects/akemona-frontend/node_modules/cipher-base’
ERROR in ./node_modules/keccak/lib/api/keccak.js Module not found: Error: Can’t resolve ‘stream’ in ‘/Users/aks/work/projects/akemona-frontend/node_modules/keccak/lib/api’
ERROR in ./node_modules/keccak/lib/api/shake.js Module not found: Error: Can’t resolve ‘stream’ in ‘/Users/aks/work/projects/akemona-frontend/node_modules/keccak/lib/api’
& Here is the warning:
WARNING in /Users/…/…/projects/…/src/app/…/web3.service.ts depends on ‘@walletconnect/web3-provider’. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (1 by maintainers)
Top GitHub Comments
hey @aksdevac @REPTILEHAUS… it’s true that we document this but it’s common practice to distribute both CJS and UMD bundles
All WalletConnect packages can fetched as UMD bundles from unpkg.com
Alternatively you can download the latest minified fields from our releases pages:
https://github.com/walletconnect/walletconnect-monorepo/releases
@aksdevac cdn is working fine. But there is one problem I am facing on mobile. When we call SignPersonalMessage function it’s redirecting to the AppStore instead of MetaMask app. Do you know what can be wrong ?