question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

signUp function error: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

See original GitHub issue

Bug 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:

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. 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. image

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:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
iniancommented, Dec 23, 2021

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

1reaction
dthyressoncommented, Dec 22, 2021

after rebasing (and manually updating the packages, at least for me) it seems to have resolved itself.

Glad to hear, @anngbaum. Let me know if you still have any issues and you can also find me on Discord.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found