I use this React Native example
After i login with my gmail, in console, it says: JSON Parse error: unexpected character: u
I use this React Native example
After i login with my gmail, in console, it says: JSON Parse error: unexpected character: u
Hi Vic! Thanks for sharing the details and the link to the example repo you’re using.
Here’s a summary of your issue for the support team:
Issue Summary
JSON Parse error: unexpected character: u
Next Steps / Info Needed
To help the team diagnose this, could you please provide:
SDK Version:
Which version of @web3auth/react-native-sdk
(and related packages) are you using? This can be found in your package.json
.
Login & Initialization Code:
Please share the code snippet where you initialize Web3Auth and handle the login. This helps us spot any configuration issues.
Console Output:
If possible, a screenshot or copy of the full error message and stack trace from your terminal or device logs.
Possible Cause & Suggestions
JSON Parse error: unexpected character: u
often happens if a function expects a JSON string but receives something else (like undefined
or a plain object).Once you provide the above details, the support team can dig deeper and help you resolve this quickly! Thank you for your patience and for trying out Web3Auth.
Note: This response was generated by an AI bot and may require further verification. The Web3Auth support team has tracked this issue and will be responding as soon as possible.
Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. Web3Auth Developer Office Hours
Are you facing this issue with other react native examples as well?
const scheme = “web3authrnexample”; // Or your desired app redirection scheme
// IMP START - Whitelist bundle ID
const redirectUrl = ${scheme}://auth
;
// IMP END - Whitelist bundle ID
this name of scheme, , this scheme is to be whitelisted in dev dashboard?
Can you switch the rpcUrl to a paid provider like Infura and try again?
This seems like an issue that has crept in due to failing public RPCs. Or you can try using any other WORKING pubic RPC like https://ethereum-sepolia-rpc.publicnode.com which I do not recommend, sincethis might go down as well, as it’s a public RPC.
sometimes when running the RN sample app, i have this error “Web3auth not initialized” in the console of the sample app.
Unfortunately, web3Auth RN SDK is poorly made, and full of bugs.
I would highly suggest you to please use paid RPC service for now as public RPCs are very unreliable. At least until the next release is out where we provide bundled premium Infura RPC access for a bunch of EVM chains. And the whole configuration is very simplified than the current setup.
Can you please try cloning the rn-bare-example here
This is in the branch test-rn-bare-example
I was able to run this example on my machine without any hiccups.
if these works for you as well, we’ll incorporate these changes to the main branch.
Good work. That works for me.
Now i am getting this error, global.base64FromArrayBuffer is not a function.
i fix it by adding base64FromArrayBuffer to globals.js