Please provide more details like,
- package.json for version
2.web3Auth instance code
Check whether you have added the prod URL on web3dashboard mainnet section or not.
use this package “@web3auth/modal”: “^4.4.2”, and try this
const web3auth = new Web3Auth({
clientId: web3clientId,
web3AuthNetwork: "mainnet",
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x1",
rpcTarget: "https://rpc.ankr.com/eth",
},
uiConfig: {
appName:'Test Web3 Auth',
theme: "dark",
loginMethodsOrder: ["google"],
}
});
await web3auth.initModal();
if (web3auth.provider) {
const web3Instance = new Web3(web3auth.provider);
const user = await this.web3auth.getUserInfo();
}else{
await this.web3auth.connect();
}
@shahbaz
hi
i am getting this error in initial connect
TypeError: Cannot convert a BigInt value to a number
here is my code
useEffect(() => {
const init = async () => {
try {
const web3auth = new Web3Auth({
clientId: “BLXQnJzDLd8Pvx6LwL8arxLz-fj8Zbx-PTi4lEOSc9tg20w1vptaiiqBPMd0gZ8mkM5E_Ubj7r3sPZJrW9k3xz4”,
web3AuthNetwork: “testnet”,
chainConfig: {
chainNamespace: “eip155”,
chainId: “0x97”,
rpcTarget: “https://data-seed-prebsc-1-s1.binance.org:8545/”,
// Avoid using public rpcTarget in production.
// Use services like Infura, Quicknode etc
displayName: “Polygon Mumbai”,
blockExplorer: “https://data-seed-prebsc-1-s1.binance.org:8545/”,
ticker: “BNB”,
tickerName: “Binance”,
},
});
console.log("initial Web3Auth", web3auth);
setWeb3auth(web3auth);
await web3auth.initModal();
} catch (error) {
console.error("Catch error in Web3Auth", error);
}
};
init();
}, []);
in catch console i am getting this error TypeError: Cannot convert a BigInt value to a number
and error in web3auth.initModal();
Hi Shahbaz, I am one of the subscribers to Web3Auth and my programmer is trying to solve this for me. Thanks for helping us.
Hi @shahbaz ,
I have sent the package.json file yesterday in the mail. Hope you received it. When can we expect an update from you.
Hey @patrick and @akashswamy.maticz
I did not receive the package.json. Which email did you send it to? Please send it to my email.
Aka, can you send please?
Hi @shahbaz can you share you mail ID or you can mailto : akashswamy.maticz@gmail.com so I can share you the json file.
Can you try changing your package.json
’s browserlist
from:
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all",
"chrome >= 67",
"edge >= 79",
"firefox >= 68",
"opera >= 54",
"safari >= 14"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
to
"browserslist": {
"production": [
"chrome >= 67",
"edge >= 79",
"firefox >= 68",
"opera >= 54",
"safari >= 14"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
Hi @shahbaz
i have try this its not worked.I am getting still error
TypeError: Cannot convert a BigInt value to a number
Hey @patrick @akashswamy.maticz
This should have fixed the issue. Can you share you package.json once again? a demo video would also help.