bitcoinjs / tiny-secp256k1

A tiny secp256k1 native/JS wrapper
MIT License
86 stars 55 forks source link

Cannot run react-app example #89

Closed victoryeo closed 1 year ago

victoryeo commented 1 year ago

After running npm install, i run npm start, but it is not possible to run the react app due to missing file. The file ../../lib/index.js is not found.

vic@vic-Lenovo-Legion-5-15ARH05:~/workspace/tiny-secp256k1/examples/react-app$ npm start

react-app@0.0.0 start /home/vic/workspace/tiny-secp256k1/examples/react-app webpack serve

[webpack-dev-server] Project is running at: [webpack-dev-server] Loopback: http://localhost:8080/ [webpack-dev-server] On Your Network (IPv4): http://192.168.100.5:8080/ [webpack-dev-server] On Your Network (IPv6): http://[fe80::7557:b6b6:ad8e:a85c]:8080/ [webpack-dev-server] Content not from webpack is served from '/home/vic/workspace/tiny-secp256k1/examples/react-app/dist' directory Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating asset bundle.js 2.25 MiB [emitted] (name: main) orphan modules 3.62 MiB [orphan] 5860 modules runtime modules 27.1 KiB 13 modules cacheable modules 1.79 MiB 170 modules

ERROR in ../random-in-node/index.js 2:0-48 Module not found: Error: Can't resolve '../../lib/index.js' in '/home/vic/workspace/tiny-secp256k1/examples/random-in-node' resolve '../../lib/index.js' in '/home/vic/workspace/tiny-secp256k1/examples/random-in-node' using description file: /home/vic/workspace/tiny-secp256k1/examples/random-in-node/package.json (relative path: .) using description file: /home/vic/workspace/tiny-secp256k1/package.json (relative path: ./lib/index.js) /home/vic/workspace/tiny-secp256k1/lib/index.js doesn't exist @ ./index.js 9:0-54 152:17-25

ERROR in ./index.js 8:0-49 Module not found: Error: Can't resolve '../../lib/index.js' in '/home/vic/workspace/tiny-secp256k1/examples/react-app' resolve '../../lib/index.js' in '/home/vic/workspace/tiny-secp256k1/examples/react-app' using description file: /home/vic/workspace/tiny-secp256k1/examples/react-app/package.json (relative path: .) Field 'browser' doesn't contain a valid alias configuration using description file: /home/vic/workspace/tiny-secp256k1/package.json (relative path: ./lib/index.js) /home/vic/workspace/tiny-secp256k1/lib/index.js doesn't exist

webpack 5.58.2 compiled with 2 errors in 4450 ms

junderw commented 1 year ago

You need to build the project first.

make build-wasm
npm ci
make build-js
cd examples/react-app && npm ci && npm run build
victoryeo commented 1 year ago

Thanks. I have created a PR with the updated README.