IPGeolocation/ip-geolocation-api-javascript-sdk

SyntaxError: Unexpected end of JSON input

Opened this issue · 0 comments

I'm receiving an error from your SDK.

SyntaxError: Unexpected end of JSON input
  at JSON.parse (<anonymous>)
  at exports.XMLHttpRequest.xhr.onreadystatechange (/workspace/server/node_modules/ip-geolocation-api-javascript-sdk/IPGeolocationAPI.js:199:33)
  at exports.XMLHttpRequest.dispatchEvent (/workspace/server/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:591:25)
  at setState (/workspace/server/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:610:14)
  at IncomingMessage.<anonymous> (/workspace/server/node_modules/xmlhttprequest/lib/XMLHttpRequest.js:447:13)
  at IncomingMessage.emit (node:events:525:35)
  at IncomingMessage.emit (node:domain:489:12)
  at endReadableNT (node:internal/streams/readable:1358:12)
  at processTicksAndRejections (node:internal/process/task_queues:83:21)

My API is crashing all the time and I can't catch this error since it is happening inside a callback:

image