WebStorm : explain 'Unresolved type Promise' highlight in code

rather new to JS and very new to WebStorm, crafting a cordova multi-device app, i get the following in one of my .js modules

Screen Shot 2015-06-19 at 4.01.07 PM.png

However, this works fine in all devices, simulators and browsers i can run on at the moment. Why am I getting this warning highlight, what configuration am i missing?? I would prefer keep the inspection than nuke it (because i am very likely to need it for my own stuff :) ),  but configure my project properly to not have 'false negatives' like this.


-- Yves

ws 10.0.4, osx 10.10.2


Obviously not since i am getting this highlight.

Newbie JS question here : it still works everywhere i deploy this (ios sim, ios device(s), android sim, android device(s), chrome,safari,and firefox browser). So somehow, that Promise is implemented everywhere. I verified in my deployment bundles, there is absolutely nothing that i deploy which implements a Promise.  All i have in my libraries right now are HTML and HTML5 Ecma5. I thought that was part of Ecma5 since it works everywhere!

How would i go about finding where it is defined (since it works) and adding that to the list of libraries of my project ?


OK , figured it out. Turns out Promise is 'standard' Ecma6. Just check it in the prefs>Languages&Frameworks->JavaScript->Libraries  as shown here

Screen Shot 2015-06-21 at 11.51.48 AM.png

cautions : this 'defines< all of ECMAScript 6 and some of it may not  be 'in the box' when you deploy. It just happens Promise is.


That did not worked for me :(


What didn't work for you?


The solution for me was to add a "promise" library in the settings:

1) go to File>Settings>Language & Frameworks>Javascript>Libraries 

2) Click Download.

3) In the dialog, select TypeScript community stubs from the dropdown.

4) Find "promise" on the list, select it and click on Download ans Install.

IntelliJ will use the TypeScript definition to inspect the JavaScript code.

(PyCharm 2016.2 / Ubuntu 16.04)



Thanks Pablo that worked!


Select the Javascript language version in the settings:


@Pablo, there is not a single promise library but many (promise-dag, promise-polyfill, etc..) . Which one does the trick ?


Same problem for me. None of the previous resolved the error. 

WebStrorm version: 2018.1

Notice that Promise is not highlighted when I use "new Promise" but is highlighted in all other cases (e.g. if I write "Promise.resolve()"

It is driving me crazy!


I'm seeing this in 2018.1.1 was well.


Promise typings are built-in, but any library that exports `Promise` may result in such issues, as WebStorm will use this module instead of a native Promise object. Related tickets: https://youtrack.jetbrains.com/issue/WEB-31084, https://youtrack.jetbrains.com/issue/WEB-30297


It's happening in IntelliJ too.  ECMA Script 6 selected and all other things working (like async / await) but Promise shows as unresolved unless you explicitly import a promise library.  Before doing that I had no promise libraries included as I'm targeting latest browsers.

It is possible that something I import includes a promise library - but it would mean not being able to use standard NPM modules, which is clearly not at option.

With a library: