Running `flow` inside a brand new project fails

Steps to reproduce:
react-native init someproject && cd someprojectflow initflow- Cry because there are 438 errors.
I am on OS X 10.10.2, iojs 1.6.3, react-native 0.3.10, and flow 0.8.
Here is the JSON from the first few errors:
{
"passed": false,
"errors": [
{
"message": [
{
"descr": "NativeModules\nRequired module not found",
"code": 0,
"path": "/Users/jergason/code/flowbreaks/node_modules/react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js",
"line": 14,
"endline": 14,
"start": 29,
"end": 52
}
]
},
{
"message": [
{
"descr": "invariant\nRequired module not found",
"code": 0,
"path": "/Users/jergason/code/flowbreaks/node_modules/react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js",
"line": 16,
"endline": 16,
"start": 17,
"end": 36
}
]
},
{
"message": [
{
"descr": "NativeModules\nRequired module not found",
"code": 0,
"path": "/Users/jergason/code/flowbreaks/node_modules/react-native/Libraries/AdSupport/AdSupportIOS.js",
"line": 14,
"endline": 14,
"start": 17,
"end": 40
}
]
},
{
"message": [
{
"descr": "NativeModules\nRequired module not found",
"code": 0,
"path": "/Users/jergason/code/flowbreaks/node_modules/react-native/Libraries/Animation/AnimationExperimental.js",
"line": 14,
"endline": 14,
"start": 27,
"end": 50
}
]
},
{
"message": [
{
"descr": "AnimationUtils\nRequired module not found",
"code": 0,
"path": "/Users/jergason/code/flowbreaks/node_modules/react-native/Libraries/Animation/AnimationExperimental.js",
"line": 15,
"endline": 15,
"start": 22,
"end": 46
}
]
},
{
"message": [
{
"descr": "identifier __DEV__\nUnknown global name",
"code": 0,
"path": "/Users/jergason/code/flowbreaks/node_modules/react-native/Libraries/Animation/AnimationExperimental.js",
"line": 75,
"endline": 75,
"start": 5,
"end": 11
}
]
},
{
"message": [
{
"descr": "ReactPropTypes\nRequired module not found",
"code": 0,
"path": "/Users/jergason/code/flowbreaks/node_modules/react-native/Libraries/Animation/LayoutAnimation.js",
"line": 14,
"endline": 14,
"start": 17,
"end": 41
}
]
},
// etc
]
}
This appears to have become an issue again on 0.17.0 of RN.
The .flowconfig requires flow at 0.19.0, which I have installed, yet it fails to resolve any react native modules:

This can be reproduced on a fresh project.
+1
+1
I feel like I have nowhere to start with using Flow right now. Has anyone got an RN project running with Flow?
cc @vjeux ^
@gabelevi is the right person to talk to about flow :)
@gabelevi Lemme know if you need help with testing this. I've a project already setup with flow.
+1, it looks like flow just does not work with RN from the box right now, any suggestions how to fix this?
All errors i see are related to require('NativeModules')
There is one solution i can propose to fix this issue - it is possible to create interface file for react-native and ExecutionEnvironment.
interfaces/react-native.js
declare module "react-native" {
declare var exports: (callback: any) => any;
}
declare module ExecutionEnvironment {
declare var exports: (callback: any) => any;
}
and add to .flowconfig
[libs]
interfaces/
....
[ignore]
.*/node_modules/react-native/.*
....
[version]
0.20.1
This works for me right now, i can create pull request to update yeoman generator
:+1:
I would love complete support out of the box. Right now I get the following out of a new project

This seems to be working for 0.21.0-rc on a fresh project. What version of RN is that @Emilios1995?
Also on a pretty new project over here, getting 19 errors from running 'flow'. RN @ 0.29.0 flow-bin @ 0.28.0
+1 (agree with cupofjoakim, have issue with default project seed)
+1. I got as same issue as the one cupofjoakim reported.
The 'init' project creates a .flowconfig which specifies [version] 0.27.0 - which works according to Michael Helvey in this stackoverflow post.
The actual issue for me is that flow binaries are not available in brew for back sourcing. I have flow version 0.23.1 and now 0.28, and 0.29.
brew upgrade flow --version 0.27.0
Error: No available formula with the name "0.27.0"
If these were available it would be simple to regress flow to the correct version, and then happy days :)
@satya164 thank you! Works a treat running via <PROJECT_ROOT>/node_modules/.bin/flow ...
but how do I include it in Nuclide?
Nuclide doesn't support it yet. But support is coming - https://twitter.com/natmote/status/755871913864466433
Any recommendations if flow should be a dev dependency of a react-native project? I'm guessing yes, since the eslint version very sensitive.
+1