paulmillr / noble-ed25519

Fastest 4KB JS implementation of ed25519 signatures
https://paulmillr.com/noble
MIT License
421 stars 52 forks source link

Uncaught TypeError: can't convert BigInt to number #34

Closed sunydev closed 2 years ago

sunydev commented 2 years ago

Hi I have this message when i run npm run build for a github page i do not have this message when i run npm start

Thanks

paulmillr commented 2 years ago

Report this to your app bundler, this is not tech support forum

binkiebinkie commented 2 years ago

I also receive this error when running the command yarn build in a React app that is using the package noble-ed25519. I believe it is related to Babel.

error

binkiebinkie commented 2 years ago

For anyone else encountering this issue I was able to overcome it by installing the @babel/plugin-syntax-bigint package in my React app. So I ran yarn add @babel/plugin-syntax-bigint, then in my babel.config.json file I added it to the plugins array like so:

{
  "plugins": ["@babel/plugin-syntax-bigint"]
}

Also, wherever you are deploying it to don't forget to clear your cache/delete node_modules

https://babeljs.io/docs/en/babel-plugin-syntax-bigint

paulmillr commented 2 years ago

Hey folks, a quick heads up: bigint literals are no longer required as per 1.3.3, so shitty build tools could proceed with noble/ed25519 without hassle.