Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught SyntaxError #68

Open
ForestBeaver opened this issue Apr 30, 2019 · 6 comments
Open

Uncaught SyntaxError #68

ForestBeaver opened this issue Apr 30, 2019 · 6 comments

Comments

@ForestBeaver
Copy link

Had a server crash with the trace: SyntaxError: Unexpected token H in JSON at position 0

var responseObj = JSON.parse(body.slice(1));

@ForestBeaver
Copy link
Author

ForestBeaver commented Apr 30, 2019

Looks like the server was returning

HTML><HEAD>

@gnongsie
Copy link
Contributor

gnongsie commented May 2, 2019

Hi,

Can you please provide information about the request you are sending and the full response you get from the servers?

@ruscon
Copy link

ruscon commented Nov 15, 2019

the same issue

[email protected]

2019-11-15T16:25:01.121Z error: uncaughtException: Unexpected token H in JSON at position 0 
SyntaxError: Unexpected token H in JSON at position 0 
    at JSON.parse (<anonymous>) 
    at Request._callback (/app/node_modules/authorizenet/lib/apicontrollersbase.js:102:29) 
    at Request.self.callback (/app/node_modules/request/request.js:185:22) 
    at Request.emit (events.js:210:5) 
    at Request.EventEmitter.emit (domain.js:476:20) 
    at Request.<anonymous> (/app/node_modules/request/request.js:1161:10) 
    at Request.emit (events.js:210:5) 
    at Request.EventEmitter.emit (domain.js:476:20) 
    at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:1083:12) 
    at Object.onceWrapper (events.js:299:28) 
    at IncomingMessage.emit (events.js:215:7) 
    at IncomingMessage.EventEmitter.emit (domain.js:476:20) 
    at endReadableNT (_stream_readable.js:1183:12) 
    at processTicksAndRejections (internal/process/task_queues.js:80:21) SyntaxError: Unexpected token H in JSON at position 0 
    at JSON.parse (<anonymous>) 
    at Request._callback (/app/node_modules/authorizenet/lib/apicontrollersbase.js:102:29) 
    at Request.self.callback (/app/node_modules/request/request.js:185:22) 
    at Request.emit (events.js:210:5) 
    at Request.EventEmitter.emit (domain.js:476:20) 
    at Request.<anonymous> (/app/node_modules/request/request.js:1161:10) 
    at Request.emit (events.js:210:5) 
    at Request.EventEmitter.emit (domain.js:476:20) 
    at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:1083:12) 
    at Object.onceWrapper (events.js:299:28) 
    at IncomingMessage.emit (events.js:215:7) 
    at IncomingMessage.EventEmitter.emit (domain.js:476:20) 
    at endReadableNT (_stream_readable.js:1183:12) 

This happens when your server gives a 500 error.
By the way, today your system has been buggy for about 15 minutes, while nothing is said about this in your monitoring system!

https://status.authorize.net/
Authorize Net+Status+2019-11-15+21-37-30

@suroorwijdan
Copy link

I can confirm this issue again.

The block is not in try catch and causes a server crash. Happening a lot of times now and sometimes the payment also goes through but it returns the above response which is very strange.

Is there anyone looking into it? I can submit a pull request to at least add better error handling to avoid crashes.

@amr-labib
Copy link

Is this issue being looked at? I have just gotten the same issue and it seems to be still existing in latest version of the SDK.

@saikumarkale
Copy link

TCS-Dev saikumarkale- issue is fixed in the latest patch, September 2024 Release - v1.0.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants