rspivak / slimit

SlimIt - a JavaScript minifier/parser in Python
MIT License
551 stars 94 forks source link

Unexpected token (SEMI, ';') at 1:1298 between ... #68

Closed stodge closed 10 years ago

stodge commented 10 years ago

I'm getting a syntax error from my javascript:

Unexpected token (SEMI, ';') at 1:1298 between LexToken(LINE_TERMINATOR,'\n',1,1295) and LexToken(CLASS,'class',1,1298)

It makes no sense - line number is 1 and the file doesn't contain the keyword "class" anywhere. jslint doesn't complain about anything in this file.

Any ideas how to identify what's causing this error? Thanks

redapple commented 10 years ago

What's your input Javascript source?

stodge commented 10 years ago

I think I found it, I have code similar to this:

someFunction({ id: 'fred', class: 'something'});

Which I changed to:

someFunction({ 'id': 'fred', 'class': 'something'});

That makes sense now, but I couldn't identify the error from slimit's output. Thanks

redyyu commented 9 years ago

I had same issus

screen shot 2015-07-10 at 5 57 59 am

the file is a angularjs file upload's lib. and it's work fine when using Nodejs's minify (grunt plugin).

I believe it is slimit's bug.