getItemData() throws JSON parsing error if data is empty
See original GitHub issueThe 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:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
Thanks @jgravois ! I submitted a PR: https://github.com/Esri/arcgis-rest-js/pull/677
Thanks for your quick fix, it works now.