showing results for - "unexpected end of json input at"
Emelie
20 Jun 2019
1You are calling:
2
3JSON.parse(scatterSeries)
4But when you defined scatterSeries, you said:
5
6var scatterSeries = []; 
7When you try to parse it as JSON it is converted to a string (""), which is empty, so you reach the end of the string before having any of the possible content of a JSON text.
8
9scatterSeries is not JSON. Do not try to parse it as JSON.
10
11data is not JSON either (getJSON will parse it as JSON automatically).
12
13ch is JSON … but shouldn't be. You should just create a plain object in the first place:
14
15var ch = {
16    "name": "graphe1",
17    "items": data.results[1]
18};
19
20scatterSeries.push(ch);
21In short, for what you are doing, you shouldn't have JSON.parse anywhere in your code. The only place it should be is in the jQuery library itself
queries leading to this page
what cause unexpected end of json inputunexpected end of json input at json parse adenunexpected end of json input at json parsenpm install unexpected end of json inputverbose stack syntaxerror unexpected end of json inputunexpected end of json input at 7b 22error 22 3a 22unexpected end of json input 22 7dinvalid json response body unexpected end of json inputreason 3a unexpected end of json input 22 2cangular unexpected end of json inputnpm err 21 unexpected end of json inputjavascript unexpected end of input jsonjson encode unexpected end of inputstring causes unexpected end of json inputeason 3a unexpected end of json inputjs syntaxerror 3a unexpected end of json inputundici response unexpected end of json inputfailed with 3a unexpected end of json inputundefined 3a1 syntaxerror 3a unexpected end of json input 3a unexpected end of json input jsunexpected end of json input 22dexexpress 22response json 28 29 syntaxerror 3a unexpected end of inputeslint error 3a unexpected end of json inputnode js syntaxerror 3a unexpected end of json inputunexpected end of json input dash app unexpected end of json inputmoduleunexpected end of json input in npm runnpm error unexpected end of json inputjson stringify syntaxerror unexpected end of json inputjson unexpected end of string json uncaught syntaxerror 3a unexpected end of json input 27syntaxerror 3a unexpected end of json input json stringifylist js unexpected end of json inputlistjs unexpected end of json inputresponse json 28 29 syntaxerror 3a unexpected end of json inputread empty json file unexpected end of json inputsyntax error unexpected end of json input 7b 22message 22 3a 22unexpected end of json input 22 2c 22status 22 3afalse 7dnode unexpected end of json inputjs unexpected end of json inputresponse json syntaxerror 3a unexpected end of input 22syntaxerror 3a unexpected end of json input 28error code 3a 4 29 22npm unexpected end of json inputsyntaxerror 3a unexpected end of json input response jsonsyntaxerror 3a unexpected end of json input angular unexpected end of json input pythonuncaught syntaxerror 3a unexpected end of json input jqunexpected end of json input devunexpected end of json input in javascripthow to solve 2f 2f json error message 3dunexpected end of json input 22sfdx 22 22unexpected end of json input 22syntaxerror 3a unexpected end of json input catch 28error 3d 3e console log 28error 29 29 22unexpected end of json input 22 not able to find lineunexpected end of json input jshow to fix unexpected end of json inputreact error syntaxerror unexpected end of json input angularunexpected end json inputspeech to textunexpected end of json input data typescriptformatexception 3a syntaxerror 3a unexpected end of json inputgoscv unexpected end of json input 22error 22 3a 22unexpected end of json input 22error syntaxerror 3a unexpected end of json input syntaxerror 3a unexpected end of json inputerror occured 3a syntaxerror 3a unexpected end of json inputsyntaxerror unexpected end of json input with json 28 29xjav reason 3a unexpected end of json input atunexpected end of json input json parseunexpected end of json input c 23list js uncaught syntaxerror 3a unexpected end of json inputunexpected end of json input exception but succeedsreason 3a unexpected end of json inputunexpected end of json outputjquery uncaught syntaxerror 3a unexpected end of json inputunhandled rejection 28syntaxerror 29 3a unexpected end of input jsonunexpected end of json unputuncaught syntaxerror 3a unexpected end of json input in chrome extensionunable to get acme account 3a unexpected end of json inputstringify uncaught syntaxerror 3a unexpected end of json inputunexpected end of input json 28 29uncaught syntaxerror 3a unexpected end of json input 27next unexpected end of json inputerrormessage unexpected end of json inputunexpected end of json input react nativeunexpected end of json input at json parse 28 anonymous 29unexpected end of json input chromeunexpected end of json input javascriptformatexception 3a unexpected end of input 28at character 1 29 jsonencodeerror 3a formatexception 3a syntaxerror 3a unexpected end of json inputuncaught syntaxerror 3a unexpected end of json input jquery syntaxerror 3a unexpected end of json input 28error code 3a 4 29unexpected end of json input at generator nextfailed 3a unexpected end of json inputan unexpected end of json input in beautifysyntaxerror 3a unexpected end of json input or 500syntaxerror 3a unexpected end of json input javascriptunexpected end of json input error on submitsyntaxerror unexpected end of json input null objectjson server unexpected end of json inputunexpected end of json input3unexpected end of json inputjsan error occurred syntaxerror 3a unexpected end of json inputerror 3a syntaxerror 3a unexpected end of json input with jquery 22uncaught syntaxerror 3a unexpected end of json input 22syntaxerror unexpected end of json inputerror check unexpected end of json inputdjango unexpected end of json inputnode 22unexpected end of json input 22angularjs unexpected end of json input then 28response 3d response json 28 29 29 unexpected end of inputunexpected end of json input responsetextupdating failed unexpected end of json inputunexpected end of json input 22 40dexexpress 22unexpected end of json input error 22tasks error 3e 3e syntaxerror 3a 22 22unexpected end of json input 22tracking exception syntaxerror 3a unexpected end of json inputunexpected end of json input gounexpected end of json input at json parse 28 3canonymous 3e 29unexpected end of json input djangointercom unexpected end of json inputunexpected end of json input at parseunexpected end of json input 22 syntaxerror 3a unexpected end of json inputunexpected end of json input nodejsdecrypt unexpected end of json inputunexpected end of json input in react jsjavascript unexpected end of json inputjs unexpected end of json input response json 28 29error 21 error 3a unexpected end of json inputunexpected end of json inputjquery min js 3a2 jquery deferred exception 3a unexpected end of json input syntaxerror 3a unexpected end of json inputcheckedornot 3a1 uncaught syntaxerror 3a unexpected end of json input upm 2fstore json 3a unexpected end of json inputunexpected end of json input golanderror unexpected end of json inputunexpected end of json input while installing react uncaught syntaxerror 3a unexpected end of json inputjquery syntaxerror 3a unexpected end of json inputerror in event handler 3a syntaxerror 3a unexpected end of json inputjquery deferred exception 3a unexpected end of json input syntaxerror 3a unexpected end of json inputvm481 3a1 uncaught syntaxerror 3a unexpected end of json inputuncaught syntaxerror 3a unexpected end of json input chrome extensionsyntaxerror plugin 3a checkmee 3a unexpected end of json inputunexpected end of json input error 3aundefined 1 syntaxerror unexpected end of json inputsfdx unexpected end of json inputvisual studio code unexpected end of json inputunexpected end of json input cgi python 22unexpected end of json input 22 react unexpected end of json inputpag seguro syntaxerror 3a unexpected end of json inputcreate checkout error error 3a unexpected end of json inputtyporm unexpected end of json inputerror 3a syntaxerror 3a unexpected end of json inputserver inject hapi 5d 22unexpected end of json inputunexpected end of json input response json 22podman 22 3a unexpected end of json inputcheck for unexpected json end of inputjson decode error 3a unexpected end of json inputsyntaxerror 3a unexpected end of json input 5cfacet error 3a syntaxerror 3a unexpected end of json inputunexpected end of json input from superagent 27unexpected end of json input 27log4js error was unexpected end of json inputuncaught syntaxerror 3a unexpected end of json input srmklivesyntaxerror 3a unexpected end of json input jsunexpected end of json input response json 28 29unexpected end of json input storybookunexpected end of json input syntaxerror 3a unexpected end of json input unexpected end of json input getitemunexpected end of json input npm installnpm i err unexpected end of json input 22unexpected end of json input 22 golangrxjs syntaxerror 3a unexpected end of json inputerro 5b0000 5d unexpected end of json inputunexpected end of json input xhttp5 3a1 uncaught syntaxerror 3a unexpected end of json inputsyntaxerror 3a unexpected end of json input doesnt tell me any infounexpected end of json input while npm installerrorthrown 3a syntaxerror 3a unexpected end of json inputjson parse unexpected end of json inputchrome json syntaxerror 3a unexpected end of json input 27 27 syntaxerror 3a unexpected end of json inputunexpected end of json input at getemployeesuncaught syntaxerror 3a unexpected end of json input 22srmklive 22vm3000 3a1 uncaught 28in promise 29 syntaxerror 3a unexpected end of json inputsyntaxerror 3a unexpected end of input reponse json 28 29syntaxerror 3a unexpected end of json input at parseresponse json 28 29 gives an error 22unexpected end of input 22 unexpected end of json input at json parse 28 3canonymous 3e 29 unexpected end of json input 2c working fine in localunexpected end of json input reactunexpected end of json input at htmlformelementunexpected end of json input tokenpatch unexpected end of json inputunhandled rejection 28syntaxerror 29 3a unexpected end of json inputunexpected end of json input reactjsresponse json 28 29 unexpected end of inputerrors syntaxerror 3a unexpected end of json inputsyntaxerror 3a unexpected end of json input at console log 28error 29unexpected end of json input dev tosyntaxerror 3a unexpected end of json input atunexpected end of json input requirestring unexpected end of json inputunexpected end of json imputcollect unexpected end of json inputunexpected end of json input 22 22syntaxerror 3a unexpected end of json input 22 2csyntaxerror 3a unexpected end of json input node unexpected end of json inputcollectd unexpected end of json inputerror 3a unexpected end of json inputsyntaxerror 3a unexpected end of json input at 3feditor console 3dtrue 3a167un 22error 22 3a 22unexpected end of json input 22unexpected end of json input typescriptunexpected end of json input in deutschajax unexpected end of json inputunexpected end of json input node jsunexpected end of json input javascript res jsonunexpected end of string jsonsyntaxerror 3a unexpected end of json input cgi fileunexpected end of json input json stringifystringify uncaught syntaxerror 3a unexpected end of json input json stringifysomething went wrong 3a syntaxerror 3a unexpected end of json inputunexpected end of json input syntaxerror 3aunexpected end of json input how to fixcollectd 22unexpected end of json input 22httparty unexpected end of json inputuncaught syntaxerror 3a unexpected end of json input at json parseunexpected end of json inpuwhat does unexpected end of json input mean 3funexpected end of json input vscodeget request unexpected end of json inputunexpected end of json input while chai testingsyntaxerror 3a unexpected end of json input 5c 5cjson stringify error unexpected end of inputjson parse syntaxerror unexpected end of json inputunexpected end of json input at eval javascriptjsonerror 3a unexpected end of input atunexpected end of json input package jsonunexpected end of json input at json parse 28 3canonymous 3e 29 at 22htmlbuttonelement 3c 22 anonymous 3eunexpected end of json input deutschsyntaxerror 3a unexpected end of json inpuunexpected end of json input 40dexexpressajax syntaxerror 3a unexpected end of json inputsyntaxerror 3a unexpected end of json input at json parse on publish response json 28 29 5 syntaxerror 3a unexpected end of input 3a unexpected end of json inputjson parse uncaught syntaxerror unexpected end of json inputsyntaxerror 3a unexpected end of input jsonvm4696 3a487 uncaught syntaxerror 3a unexpected end of json input json 28 29 unexpected end of json inputunexpected end of json input at loaddata4django delete unexpected end of json inputncaught syntaxerror 3a unexpected end of json inputunexpected end of jsonuncaught syntaxerror 3a unexpected end of json input javascriptsyntaxerror 3a unexpected end of json inputunexpected end of json input messagequeue jshow to debug unexpected end of json inputunexpected end of json 3adata type of string json unexpected end of inputpromise unexpected end of json inputuncaught sysntaxeror unexpected end of json input annoymouunexpected end of input jsonunexpected end of json input api callsyntaxerror 3a unexpected end of json input 29 please try again unexpected end of json input exception with escapesunhandled rejection 28error 29 3a unexpected end of json inputunexpected end of json input while parsinunexpected end of json input at json parse 28 3canonymous 3e 29 at object success syntaxerror 3a unexpected end of json inputajax syntaxerror 3a unexpected end of json inputreact unexpected end of json inputerror 3a syntaxerror 3a unexpected end of json input for json stringify reason 3a unexpected end of json inputparsererror 22 syntaxerror 3a unexpected end of json inputdata undefined syntaxerror 3a unexpected end of json inputchrome uncaught syntaxerror 3a unexpected end of json input at json parse reason 3a unexpected end of json input codegensyntaxerror 3a unexpected end of input json reactunexpected end of json input 2cangular unexpected end of json input installation errorunexpected ending of json inputunexpected end of json input json stringify errorunexpected end of json input undefinedmessage 3a 22unexpected end of json input 22unexpected end of json input jqueryganttunexpected end of json input at eval 22unexpected end of json input 22ile 29 3a syntaxerror 3a unexpected end of json inputunexpected end of json input but string is valid jsonunexpected end of json input expressundefined 3a1 syntaxerror 3a unexpected end of json input 28index 29 3a20 uncaught syntaxerror 3a unexpected end of json inputcatch unexpected end of json input error reacthow to handle syntaxerror 3a unexpected end of json inputserver inject hapi 22unexpected end of json inputan unexpected end of json inputmessage 3dunexpected end of json input 2c stack 3dsyntaxerror 3a unexpected end of json inputunexpected end of json input react while installingyntaxerror 3a unexpected end of json inputunexpected end of json input in javascrip how to fixunexpected end of json input at