-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug found in web3-utils/lib/esm/converters.js #6415
Comments
@rickychen-xm pls provide a code snippet to reproduce this and we need web3.js version. |
The error log shows that the error occurred in the 'expo10' function in the 'converters.js' file of the web3-utils library. The 'expo10' function is used to calculate the power of 10 for a given number of decimal places. It is possible that the function is being passed a BigInt value instead of a Number value, causing the ValueError. Share the code snippet, if you still encountering this issue. |
@rickychen-xm share code snippet for reproducing this. |
Hi All
Thanks for your kindly confirmation and sorry for my late reply.
The web3.js that configured in my packjson.file is "web3": "^4.1.0"
And pls refer to the attached file.
Best Regards.
From Ricky.
发件人: Ranjan Soumya ***@***.***>
日期: 星期日, 2023年9月17日 18:56
收件人: web3/web3.js ***@***.***>
抄送: Ricky ***@***.***>, Mention ***@***.***>
主题: Re: [web3/web3.js] Bug found in web3-utils/lib/esm/converters.js (Issue #6415)
The error log shows that the error occurred in the 'expo10' function in the 'converters.js' file of the web3-utils library. The 'expo10' function is used to calculate the power of 10 for a given number of decimal places. It is possible that the function is being passed a BigInt value instead of a Number value, causing the ValueError.
Share the code snippet, if you still encountering this issue.
―
Reply to this email directly, view it on GitHub<#6415 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEBKPPTUVHT4WZ2IITZI74DX23JOFANCNFSM6AAAAAA4SB27IE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hello @rickychen-xm, |
I found one bug in below file
web3-utils/lib/esm/converters.js
It seems that is a error with the different type between BigInt and Number.
Pls help confirm.
the error log as below:
Cannot convert a BigInt value to a number TypeError: Cannot convert a BigInt value to a number at Math.pow () at expo10 (http://localhost:3000/static/js/bundle.js:107249:15) at ./node_modules/web3-utils/lib/esm/converters.js (http://localhost:3000/static/js/bundle.js:107256:9) at options.factory (http://localhost:3000/static/js/bundle.js:119570:31) at webpack_require (http://localhost:3000/static/js/bundle.js:119010:33) at fn (http://localhost:3000/static/js/bundle.js:119227:21) at ./node_modules/web3-utils/lib/esm/index.js (http://localhost:3000/static/js/bundle.js:108457:72) at options.factory (http://localhost:3000/static/js/bundle.js:119570:31) at webpack_require (http://localhost:3000/static/js/bundle.js:119010:33) at fn (http://localhost:3000/static/js/bundle.js:119227:21)
The text was updated successfully, but these errors were encountered: