Electron Chrome fetch is returning "SyntaxError: Unexpected end of JSON input"
See original GitHub issueWhat 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.
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:
- Go to: …
- Execute this command: …
- 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:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
@Farfurix Okay, I’ll work on getting a minimal project. Thanks
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.