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.

getItemData() throws JSON parsing error if data is empty

See original GitHub issue

The error is:

Fetch item data error. SyntaxError: Unexpected end of JSON input
    at eval (VM12042 request.js:134)

If the data is empty, this function could return null instead of forcing consuming apps to test for the above error.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pfcstylecommented, Mar 26, 2020
1reaction
qlqllucommented, Apr 11, 2019

Thanks for your quick fix, it works now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript, JSON.parse error: "Type 'null' is not assignable to ...
As the error says, localStorage.getItem() can return either a string or null. JSON.parse() requires a string, so you should test the result of ......
Read more >
SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >
JSON functions | BigQuery - Google Cloud
The following examples explore how invalid requests and empty arrays are handled: -- An error is thrown if you provide an invalid JSONPath....
Read more >
Resolve JSON errors in Amazon Athena - AWS
When I try to read JSON data in Amazon Athena, I receive NULL or ... This causes the following error message: HIVE_BAD_DATA: Error...
Read more >
Ignoring null value's when parsing JSON payload
Parse JSON is throwing error message "message": "Invalid type. ... and/or coalesce() function would work, but they require some hand-crafting if being used ......
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