Skip to content

SyntaxError: Unexpected end of JSON input #11

Description

@sayhicoelho

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions