functionland / fula-archived

Client-server stack for Web3! Turn your Raspberry Pi to a BAS server in minutes and enjoy the freedom of decentralized Web with a superior user experience!
https://fx.land
MIT License
4 stars 0 forks source link

when building react samples there is a libp2p error #145

Closed gitaaron closed 2 years ago

gitaaron commented 2 years ago

Steps to reproduce

  1. Create build output
    cd examples/react-gallery && npm run build
    cd build && serve .
  2. Open output in browser ( localhost:3000 ) and see the following error -
    Uncaught TypeError: Cannot convert a BigInt value to a number
    at Math.pow (<anonymous>)
    at ../../common/temp/node_modules/.pnpm/@noble+ed25519@1.6.0/node_modules/@noble/ed25519/lib/index.js (index.js:13:21)
    at wrapNativeSuper.js:36:27
    at ../../common/temp/node_modules/.pnpm/libp2p-crypto@0.21.2/node_modules/libp2p-crypto/src/keys/ed25519.js (ed25519.js:3:12)
    at wrapNativeSuper.js:36:27
    at ../../common/temp/node_modules/.pnpm/libp2p-crypto@0.21.2/node_modules/libp2p-crypto/src/keys/ed25519-class.js (ed25519-class.js:8:16)
    at wrapNativeSuper.js:36:27
    at ../../common/temp/node_modules/.pnpm/libp2p-crypto@0.21.2/node_modules/libp2p-crypto/src/keys/index.js (index.js:14:12)
    at wrapNativeSuper.js:36:27
    at ../../common/temp/node_modules/.pnpm/peer-id@0.16.0/node_modules/peer-id/src/index.js (index.js:16:20)
farhoud commented 2 years ago

@gitaaron For samples we should first create a deploy scenario. The work flow for rush is to first run: rush deploy and then we can use the npm run build && cd build && serve . command and serve.

Underling cause is esbuild can not bundle libp2p. and its external.