Flow: unresolved type $ReadOnlyArray

I'm trying to get the IDE to recognize Flow native types, but with no success.

I have ESLint installed on my project. Not sure why Flow isn't able to parse them.

All my node modules are latest.

Here's a portion of what my .eslintrc.json looks like:

"env": {
"es6": true,
"node": true
"extends": ["eslint:recommended"],
"globals": {
"$ReadOnlyArray": true,
"parser": "babel-eslint",
"plugins": [

What error do you see namely? Please provide code snippet and a screenshot of the error message


The error message is simply `unresolved type $ReadOnlyArray`

It's as though flow/eslint is unable to recognise this type.


as for a code snippet, you can simply do this:

type Abc = $ReadOnlyArray<any> // Shows the error.

type Def = Array<any>  // Works fine.


Webstorm doesn't use .eslintrc for types resolving, so adding types to ESlint globals won't help. Neither it supports Flow libdefs  - see https://youtrack.jetbrains.com/issue/WEB-27437


That's strange because another project of mine works fine and I have no idea why. It uses the same .eslintrc, slightly earlier versions of relevant node modules.

I.e. the IDE recognises the type $ReadOnlyArray and provides proper code-completion.

Also libraries on github (i.e. those which use flow and utilize newer flow types like $ReadOnlyArray) work properly when opened in the IDE.


it must be resolving this definition from certain file you have in your project... You can Ctrl+click on it to see what definition is being used



I notice that the problem goes away when I switch the IDE to use Flow globally rather than from the Project modules.

My version of Flow installed globally is 0.59, while the project Flow module is 0.61. These utility types existed since 0.34...


Is there a reason why both flow packages would yield differently?


Any resolution here? I'm getting a similar error with flow-bin version 0.69 when I use utility types like $Keys. I get a Webstorm error "Unresolved type $Keys".

My Preferences > Languages & Frameworks > Javascript > Javascript language version is set to "Flow".

I'm using Webstorm 2018.2.3 build #WS-182.4323.44


No resolution so far... please follow https://youtrack.jetbrains.com/issue/WEB-32425 and linked tickets for updates


To resolve the issue, you can try adding Flow core library global type definitions to your project javaScript libraries, as it's suggested in https://youtrack.jetbrains.com/issue/WEB-32396


Please sign in to leave a comment.