Unexpected Token error in HTML and CSS
I have recently started using Webstorm and I am on a very novice level.
After I run the debugger, every line of code I hover over creates a label with some variation of "SyntaxError: Unexpected Token".
In HTML, for every line with an element tag it says "SyntaxError: Unexpected Token <".
In CSS, for every line with a class selector it says "SyntaxError: Unexpected Token .".
In CSS, for every line with an ID selector it says "SyntaxError: Invalid or unexpected Token .".
And other variations for different statements.
Why is this happening and how do I fix this?
Thanks
请先登录再写评论。
Hi there,
I'm sorry to say this .. but you have to provide some screenshots where content with error will be visible (ideally using Default color schema) -- it's very unclear on what is happening there/what may have caused this.
Right now I may only suggest to try "File | Invalidate Caches..." and restart IDE -- usually helps in "worked yesterday and suddenly stopped working" situations.
Sure, very basic code.
Or
I tried "Invalidate Caches". Didn't work.
Thank you
What color scheme is that? It does not look like Default (at very least it differs from what I see here in PhpStorm).
But anyway -- the file seems to be HTML (based on file icon) ... and I do not see any errors/warnings (they will usually have yellow-brown background for Warnings and red for Errors).
Those popups .. they are indeed Debug popups -- they usually shown when you hover over a variable when debugging. I'm not sure at all if they should be showing for HTML/CSS code (but maybe it's normal -- I've never tried to do that on plain HTML file -- I'm using templating engines so never have to look at source HTML when debugging).
How did you run the debug session? What kind of Run/Debug Configuration is that? I assume it's "JavaScript Debug"?
Yeah, sorry if i'm providing vague information. Like I said, I'm a beginner.
Yes it is "JavaScript Debug".
It's a known usability issue - https://youtrack.jetbrains.com/issue/WEB-19390;
Good to know. Thank you