Standard JavaScript: "Unresolved variable type or type document"
Hi,
I try something simple like this:
var cont = document.querySelector('myDiv');
PhpStorm is rebelling against objects like "document" or methods like "querySelector" - standard JS stuff, from what i know - and says "Unresolved variable type or type document".
Why is that? How can I fix that?
And there is still no solution for how to include type recognition and syntax highlighing/autocomplete for webAudio and webMIDI - any news concerning support for that kind of JS?
Thanks!
请先登录再写评论。
Just tried that on a dummy project - works well here and there. Could you please check if you have the same behavior in a completely new project? Are you on latest PhpStorm version (2017.3.1)?
Thank you for your response!
I am on 2017.3.2 (see screenshot).
And yes, of course I tested with new setups. Like now: another screenshot shows a new HTML Boilerplate project.
Also did "Invalidate Caches and Restart"... and just standard plugins, nothing external, only phpStorm stuff.
And another screenshot shows, what "Languages & Frameworks " => "JavaScript" => "Libraries" looks like...
Any ideas?
I cleared whatever phpstorm-related things I found in any of the Library folders on my Mac - now the syntax highlighting is working again, and WebAudio seems to be recognized, too.
Thank for your feedback again!
Have a merry Christmas!
I'm having a similar problem, what files/folders did you clear out? I tried the exact same as above with the same problem.
First, i uninstalled all plugins that are not native to PhpStorm. Then I used the "invalidate caches / restart" function. After that, i went through all the library and Application Support folders on my Mac and removed them. Be aware: saved settings will get lost!
But - in retrospective - I think you should start with uninstalling plugins. That probably should do it. (Maybe you have things installed that deal with React or Angular?)
FWIW: I tracked the problem down to my own over-ride in the idea.properties file, I had set:
> idea.max.intellisense.filesize=250
Once I had removed that, Invalidated Caches things looked better. I believe I also had to reset my project files due to old/outdated/incorrect jsLibraryMappings file content.
Had this issue in Webstorm 2019.1.
Resolved after disabling plugins from previous version that marked as incompatible with this version.
Thanks @Client Priest
Closing the IDE and removing the .idea folder in the project fixed this issue.