"Expected Expression" Syntax highlighting error on first line of JS file in PHPStorm

I have a JS file where no matter what is placed on the first line (comment or code), PHPStorm generates a syntax error. When I hang over the error, the description says "Expected Expression." What does it look like:

enter image description here

Is this a bug with the IDE or something that can be disabled?

EDIT

File example here

+8
phpstorm
source share
2 answers

You have a signature of the UTF-8 specification ( EF BB BF ) immediately before the line var myApp= (first line of code in this file)

enter image description here

If you delete it, the IDE will stop complaining.

PS
Yes. In this case, the IDE should be smarter and should provide a better error message and error location. Feel free to send your new ticket to Tracker Issue at http://youtrack.jetbrains.com/issues/WI

+13
source share

In most cases, this problem occurs due to copying. There may be some characters / line that may need to be rewritten in your IDE.

In such cases, just copy your code into notepad and copy it back into your IDE again.

+1
source share

All Articles