Uncaught SyntaxError: Unexpected end of JSON input
See original GitHub issueI am getting this error on reload of the client, otherwise seems to work.
index.html#/:1 Uncaught SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at IncomingMessage.eval (eval at <anonymous> (bundle.js:4112), <anonymous>:108:31)
at emitNone (events.js:91)
at IncomingMessage.emit (events.js:188)
at endReadableNT (_stream_readable.js:975)
at _combinedTickCallback (internal/process/next_tick.js:80)
at process._tickCallback (internal/process/next_tick.js:104)
(anonymous) @ request.js?c6b6:75
emitNone @ events.js:91
emit @ events.js:188
endReadableNT @ _stream_readable.js:975
_combinedTickCallback @ internal/process/next_tick.js:80
_tickCallback @ internal/process/next_tick.js:104
Server is running origin/cardano-sl-1.0 front end is running daedalus master
Here is where it is happening in request.js
response.on('end', () => {
const parsedBody = JSON.parse(body);
The this.req.res.statusCode== 404 and is not being checked.
Now there are two files that look very similar: https://github.com/input-output-hk/daedalus/blob/master/app/api/etc/lib/request.js#L36 and https://github.com/input-output-hk/daedalus/blob/master/app/api/ada/lib/request.js#L75
Body is empty:
The incoming message is a 404 not found!
IncomingMessage {_readableState: ReadableState, readable: false, domain: null, _events: EventHandlers, _eventsCount: 3…}
statusCode:404
statusMessage :"Not Found"
The request is “/api/settings/time/difference”
Here is what I found in the _header : .req.socket._httpMessage._header
“GET /api/settings/time/difference HTTP/1.1 Host: localhost:8090 Connection: close”
Posted on Utopian.io - Rewarding Open Source Contributors
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Uncaught SyntaxError: Unexpected end of JSON input
A common error encountered by JavaScript programmers is the Uncaught SyntaxError: Unexpected end of JSON input. This is usually observed when the coder...
Read more >Uncaught SyntaxError: Unexpected end of JSON input at ...
When you try to parse it as JSON it is converted to a string ( "" ), which is empty, so you reach...
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 >Unexpected end of JSON input Error in JavaScript - Stack Diary
The "Unexpected end of JSON input" error is a syntax error that occurs when the JSON you're trying to parse is incomplete or...
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
the api is there is in the unreleased version I am using. https://github.com/input-output-hk/cardano-sl/commit/58bd3caab1779b2cd71f0298bc18f766cdd80ab8#diff-1cd0b0acca347cce42b9aea9b5122eed
See https://github.com/input-output-hk/cardano-sl/blob/429efc2426c63802ae86789f5b828dcbb42de88a/wallet-new/README.md
This issue is no longer reproducible in the latest Daedalus version.