question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Electron Chrome fetch is returning "SyntaxError: Unexpected end of JSON input"

See original GitHub issue

What is your Scenario?

In my Electron app, I’m trying to read the body of the post response to a login endpoint on a service that is running at http://127.0.0.1:44151/login on the local computer, but it appears that the body has already been consumed.

image

Either that or it’s related to the status 222

hammerhead.js:6 09:58:36.329 › { method: 'POST',
  mimeType: 'text/html',
  responseBody: '',
  status: 222,
  statusText: 'unknown',
  url:
   'http://172.20.6.65:52047/XDXWD8o_c/http://127.0.0.1:44151/login' }

What is the Current behavior?

What is the Expected behavior?

What is your public web site URL?

Your website URL (or attach your complete example):

Your complete app code (or attach your test files):
 
Screenshots:

Steps to Reproduce:

  1. Go to: …
  2. Execute this command: …
  3. See the error: …

Your Environment details:

  • node.js version: 10.15.3

  • browser name and version: Chrome (Electron) “69.0.3497.128”

  • platform and version: Windows 10

  • other:

  • electron: 4.2.0

  • testcafe: 1.8.2

  • testcafe-hammerhead: 16.1.2

  • testcafe-browser-provider-electron: 0.0.13

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ericpylecommented, Mar 2, 2020

@Farfurix Okay, I’ll work on getting a minimal project. Thanks

0reactions
lock[bot]commented, Mar 21, 2020

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Uncaught (in promise) SyntaxError: Unexpected end of input ...
Sounds like the server is returning an empty JSON response. Use the Network tab of the browser to see what's being returned. –...
Read more >
Unexpected end of JSON input Error in JavaScript | bobbyhadz
The "Unexpected end of JSON input" error occurs when trying to parse invalid JSON using the JSON.parse or $.parseJSON methods. Trying to parse...
Read more >
"Unexpected end of JSON input" - possible fixes - LinuxPip
“Unexpected end of JSON input” (or “Uncaught SyntaxError: Unexpected end of JSON input”) is a common error message in JavaScript, ...
Read more >
Syntaxerror: Unexpected End Of Json Input When Using Fetch()
This error is mainly caused by empty returned ajax calls when trying to parse an empty JSON. To solve this test if the...
Read more >
Getting error "Unexpected end of JSON input" while ...
Respected I am using HTML-PHP web SDK. I am getting error “Unexpected end of JSON input” in html page. But I payment made...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found