Fail silently when API JSON response parsing failed
See original GitHub issueI use react-table in a secure build environment. API requests from the build gets blocked. So when scarfJS tried to send same, it got blocked. I tried adding disable package.json config but didn’t work. Following is the error observed
16:26:52
16:26:52 SyntaxError: Unexpected end of JSON input
16:26:52 at JSON.parse (<anonymous>)
16:26:52 at /local/apps/test/frontend/node_modules/@scarf/scarf/report.js:65:27
16:26:52 npm ERR! code ELIFECYCLE
16:26:52 npm ERR! errno 1
16:26:52 npm ERR! @scarf/scarf@0.1.5 postinstall: `node ./report.js`
16:26:52 npm ERR! Exit status 1
16:26:52 npm ERR!
16:26:52 npm ERR! Failed at the @scarf/scarf@0.1.5 postinstall script.
16:26:52 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
16:26:52
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Proper way to catch exception from JSON.parse - Stack Overflow
i post something into an iframe then read back the contents of the iframe with json parse...so sometimes it's not a json string....
Read more >Error while parsing JSON Response in REST API Post call
I switched to returning a JSON String and then Deserialize the JSON String, it still raises an error "Failed to parse response of...
Read more >SyntaxError: JSON.parse: bad parsing Breaking Your Code ...
The JSON Parse error, as the name implies, surfaces when using the JSON. parse() method that fails to pass valid JSON as an...
Read more >How to avoid building apps that crash by parsing JSON the ...
First of all, if the response is a JSON array instead of a dictionary, your app will crash at runtime. And second –...
Read more >jQuery.getJSON() | jQuery API Documentation
Important: As of jQuery 1.4, if the JSON file contains a syntax error, the request will usually fail silently. Avoid frequent hand-editing of...
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
Sure thing! API calls will not be fired if scarf is disabled