Skip to content
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

web3js@latest : Uncaught TypeError: Do not know how to serialize a BigInt #6660

Closed
zoubair-hattab opened this issue Dec 13, 2023 · 5 comments

Comments

@zoubair-hattab
Copy link

Could you please assist me in resolving an issue with the latest version of web3.js 4.x. I'm attempting to connect with MetaMask using the following code:

export const loadWeb3 = async (dispatch) => {
console.log(Web3);
const web3 = new Web3(Web3.givenProvider || 'http://localhost:8545');
dispatch(actions.web3Loaded(web3));
return web3;
};

However, I've encountered an error: "Do not know how to serialize a BigInt TypeError: Do not know how to serialize a BigInt." The interesting part is that everything works perfectly when I use a legacy version of web3.js. Any insights or assistance would be greatly appreciated.

@mconnelly8
Copy link

Hey @zoubair-hattab, take a look at this solution and let me know if that helps.

JS doesn't support serialization of BigInt yet.

@zoubair-hattab
Copy link
Author

@mconnely8:i have used this but the same issue still

@mconnelly8
Copy link

@zoubair-hattab, can you send me the code snippet you are using with that workaround?

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

@github-actions github-actions bot added the Stale Has not received enough activity label Feb 21, 2024
@mconnelly8 mconnelly8 removed the Stale Has not received enough activity label Feb 21, 2024
@mconnelly8
Copy link

Hey @zoubair-hattab, closing this issue do to no response. If you are still experiencing the issue, please provide us with the code snippet to review and reopen. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@zoubair-hattab @mconnelly8 and others