signUp function error: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
See original GitHub issueBug report
Describe the bug
When I use signUp based on Supabase’s documentation, I get a SyntaxError that only comes up with dealing JSON. Extremely confused with why this is happening as I’m only following what the documentation is showing.
To Reproduce
` const onSubmit = async data => {
console.log(data.email)
console.log(data.password)
console.log(typeof(data.email))
console.log(typeof(data.password))
const {user, error} = await supabase.auth.signUp({
email : data.email,
password : data.password
})
console.log(error)
console.log(error)
console.log(user)
} `
Steps to reproduce the behavior, please provide code snippets or a repository:
- Go to ‘…’
- Click on ‘…’
- Scroll down to ‘…’
- See error
Expected behavior
I expected the signUp function to take in my two strings and register them as a user
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: [e.g. macOS, Windows] Windows
- Browser (if applies) [e.g. chrome, safari] Chrome
- Version of supabase-js: [e.g. 6.0.2] latest version
- Version of Node.js: [e.g. 10.10.0] 14.15.3
Additional context
Add any other context about the problem here.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
React Js: Uncaught (in promise) SyntaxError: Unexpected ...
Once I moved the json file into that folder, the 404 turned into a 200, and the Unexpected token < in JSON at...
Read more >SyntaxError: Unexpected token < in JSON at position 0
SyntaxError : Unexpected token < in JSON at position 0. Im trying to get a single object from the api, it worked fine...
Read more >How to Fix SyntaxError: Unexpected token < in JSON at ...
Usually this error is caused when your server returns HTML (which typically begins with <DOCTYPE html> or <html> ) instead of JSON. Valid...
Read more >Unexpected token < in JSON at position 0 - Dave Ceddia
The exact text of this error will differ depending on what the server returned. The token and the position may vary, but the...
Read more >unexpected token '<', "<!doctype "... is not valid json - You.com
Usually this error is caused when your server returns HTML (which typically begins with <DOCTYPE html> or <html> ) instead of JSON. Valid...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This issue is because of a backend API call failing. This could be a storage, auth, realtime API call and will vary depending on each project, user. If you are facing this issue, it might be due to your project running out of its allocated resources. You can check your reports tab to get more insight there.
Closing the issue here since we can’t do much without knowing your project id etc. If you are facing this error, reach out to us at https://app.supabase.io/support/new
Glad to hear, @anngbaum. Let me know if you still have any issues and you can also find me on Discord.