Uncaught SyntaxError: Unexpected end of input error in Chrome

Today, while I was working with jQuery I ran on this error “Uncaught SyntaxError: Unexpected end of input” while troubleshooting my code in Chrome. And since Chrome it didn’t report error on any specific line I had to Google for it :)

And after opening few pages I found out that this error codes happens when you forget closing “}”. That can happen often when writing JavaScript and especially jQuery code. Locating that is not easy, especially if you’r code is sloppy and you have a lot of it. Luckily my code is always very nicely written so I got it solved quickly. But in case you’r code is really messy or is compressed (with some JavaScript compressing tool lik jscompress.com) you can copy/paste your javascript code into jsbeautifier.org, click on “Beautify JavaScript” (select the options you want on the right side of the screen first) and see if all of the indentations are correct. Beautiful and Geeky.

Tags: Uncaught SyntaxError: Unexpected end of input, uncaught syntaxerror unexpected end of input line 1, unexpected end of input, uncaught, uncaught syntaxerror unexpected end of input, unexpected end of input line 1, javascript unexpected end of input line 1, javascript unexpected end of input, uncaught syntaxerror: unexpected end of input line 1, jquery unexpected end of input, syntaxerror: unexpected end of input, syntaxerror unexpected end of input, decompression problem unexpected end of input file or i/o error, decompression problem unexpected end of input file or i o error, uncaught syntaxerror unexpected end of input jquery, unexpected end of input js, unexpected end of input javascript line 1, Error:Cause: unexpected end of block data, jquery Uncaught SyntaxError: Unexpected end of input, js Unexpected end of input, syntaxerror, unexpected end of input javascript, Uncaught SyntaxError: Unexpected identifier, ncaught SyntaxError: Unexpected end of input, decompression problem unexpected end of data, unexpected, Uncaught SyntaxError: Unexpected end of input at, advanced, Uncaught SyntaxError: Unexpected end of input 错误, uncaught unexpected end of input, syntaxerror unexpected end of data, unexpected end of block data, javascript JSON parse Uncaught SyntaxError: Unexpected end of input, unexpected end input, Uncaught SyntaxError: Unexpected end of input at file://mnt

3 thoughts on “Uncaught SyntaxError: Unexpected end of input error in Chrome

  1. S Coulson

    I just got this error and all my braces were perfect. In fact, all my code was … erm.. “perfect”.
    For me the problem turned out to be improperly formed JSON data I was getting from the server. For some reason the data was truncated (thus naturally missing a few closing braces) and it blew up in JSON.parse() – which kind of makes it seem like JSON.parse is using eval() which I thought it shouldn’t, but Chrome seemed to be giving me this error at the top of the function in which the JSON.parse() was being called. It was very perplexing until I took a look at what data was coming across the wire.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>