0

Unexpected token < in JSON at position 0

  • :null in parse
  • node_modules\react-native\node_modules\promise\setimmediate\core.js:37:11 in tryCallOne
  • node_modules\react-native\node_modules\promise\setimmediate\core.js:123:14 in setImmediate$argument_0
  • ... 8 more stack frames from framework internals

enter image description here

I am using a one page update records, but when I disable that the error still shows. I thought it might had something to do with the reviews on the update page (as I moved the reviews out of the tabs), but undoing that change didn't fix the error on the update pages.

3
  • 1
    do not upload your image as code. provide minimal reproducible code. provide a full error message. It's unclear on which line of the app.js the error is happening. Some values in your JSON.stringify might be null that's why it's saying null in parse. try debugging and see which values are null. Commented Jan 4, 2021 at 4:36
  • I think it's line number 226 response.json(), throwing the error. Mostly your response will be an HTML document instead of JSON and hence the error, can you please paste the response also here? Commented Jan 4, 2021 at 4:44
  • I found the error. Just Change method POST to PUT Thank you all. Commented Jan 4, 2021 at 6:54

1 Answer 1

1

There is probably an error with data you try to pass . You are expecting a Json but the '<' token error shows that your data is not a json object . Check your json again .

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.