Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

find error in javascript

I have a few javacsript files, and I'm using a js packer to pack them, then combine them all and include them in a page.

The problem is that after they are packed I'm getting this error:

Error: missing ; before statement

I assume it's because somewhere in the js file a new line is used instead of the ; character, and since the packer removes new lines you get the error

so, how could I find where ; is ommited in the script(s)?

like image 293
Alex Avatar asked Jan 21 '23 16:01

Alex


1 Answers

There exists a tool called jslint which can statically analyse JavaScript source code with many option. It should tell you where the failure is. There is also an online version available. Check it out: http://www.jslint.com/

like image 113
guido Avatar answered Jan 29 '23 10:01

guido