Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Required fields*

No visible cause for "Unexpected token ILLEGAL"

I'm getting this JavaScript error on my console:

Uncaught SyntaxError: Unexpected token ILLEGAL

This is my code:

var foo = 'bar';​

It's super simple, as you can see. How could it be causing a syntax error?

Answer*

Cancel
6
  • 6
    You literally saved my day. I've struggled with Nginx + Vagrant for a whole evening, and this solved it.
    – fradeve
    Commented Jul 9, 2014 at 15:47
  • 2
    Did NOT expect this to be the right answer (for me) but it was, thanks so much.
    – Belladonna
    Commented Jul 31, 2014 at 19:45
  • 2
    Actually, it stopped working. Then again there're multiple layers of symlinking at play here so I just undid what I could.
    – Belladonna
    Commented Aug 1, 2014 at 18:24
  • Thanks - I was in a vagrant box with nginx. I've also seen this issue on similar Apache setups.
    – Cameron
    Commented Jul 28, 2015 at 22:49
  • for apache: EnableSendfile Off
    – jamlee
    Commented Mar 21, 2016 at 13:25