'expression expected' error on flow annotations

Webstorm can't properly parse some flow annotations when the javascript version is set to flow.

The code:


// @flow
export const x = ['a', 'b'].map<*>(letter => ({ letter }));


triggers an "expression expected" error under the star.  This is valid flow annotated javascript but isn't understood by webstorm.  How do I resolve this error?

Comment actions Permalink

Works fine for me:

what IDE version do you work with? did you try invalidating caches?

Comment actions Permalink


WebStorm 2018.1
Build #WS-181.4203.535, built on March 22, 2018
JRE: 1.8.0_152-release-1136-b20 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.2

That was the problem, updating it to WebStorm 2018.3 worked. Thanks!


Please sign in to leave a comment.