Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow Type Errors Examples/UIExplorer #938

Closed
chrisalexander55 opened this issue Apr 21, 2015 · 21 comments
Closed

Flow Type Errors Examples/UIExplorer #938

chrisalexander55 opened this issue Apr 21, 2015 · 21 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@chrisalexander55
Copy link

The examples directory generates Flow errors. Did I do anything wrong? Works on Mac I configured at work but not at home (same OSX version with installed updates). Also, I can't detect if any dependenc(ies) have been updated since arriving at home.

Here is the screen cap:

screen shot 2015-04-20 at 9 14 42 pm

And here is the Flow printf:

flow: Running static typechecks.
flow: Error running command cd "/Users/james/Projects/react-native" && flow --json --timeout 20:
{"status":500,"message":"Flow found type errors. If you think these are wrong, make sure your flow bin and .flowconfig are up to date, or disable with --skipflow.","type":"FlowError","errors":[{"description":"E1: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/2048/Game2048.js","lineNumber":0,"column":0},{"description":"E2: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/Movies/MovieCell.js","lineNumber":0,"column":0},{"description":"E3: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/Movies/MovieScreen.js","lineNumber":0,"column":0},{"description":"E4: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/Movies/MoviesApp.js","lineNumber":0,"column":0},{"description":"E5: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/Movies/SearchScreen.js","lineNumber":0,"column":0},{"description":"E6: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/Movies/getStyleFromScore.js","lineNumber":0,"column":0},{"description":"E7: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/TicTacToe/TicTacToeApp.js","lineNumber":0,"column":0},{"description":"E8: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/ActionSheetIOSExample.js","lineNumber":0,"column":0},{"description":"E9: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/ActivityIndicatorIOSExample.js","lineNumber":0,"column":0},{"description":"E10: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/AdSupportIOSExample.js","lineNumber":0,"column":0},{"description":"E11: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/AlertIOSExample.js","lineNumber":0,"column":0},{"description":"E12: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/AppStateIOSExample.js","lineNumber":0,"column":0},{"description":"E13: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/AsyncStorageExample.js","lineNumber":0,"column":0},{"description":"E14: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/CameraRollExample.ios.js","lineNumber":0,"column":0},{"description":"E15: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/CameraRollView.ios.js","lineNumber":0,"column":0},{"description":"E16: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/DatePickerIOSExample.js","lineNumber":0,"column":0},{"description":"E17: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/GeolocationExample.js","lineNumber":0,"column":0},{"description":"E18: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/ImageCapInsetsExample.js","lineNumber":0,"column":0},{"description":"E19: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/ImageExample.js","lineNumber":0,"column":0},{"description":"E20: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/LayoutExample.js","lineNumber":0,"column":0},{"description":"E21: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/ListViewExample.js","lineNumber":0,"column":0},{"description":"E22: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/ListViewPagingExample.js","lineNumber":0,"column":0},{"description":"E23: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/MapViewExample.js","lineNumber":0,"column":0},{"description":"E24: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/NavigatorIOSExample.js","lineNumber":0,"column":0},{"description":"E25: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/NetInfoExample.js","lineNumber":0,"column":0},{"description":"E26: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/PanResponderExample.js","lineNumber":0,"column":0},{"description":"E27: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/PickerIOSExample.js","lineNumber":0,"column":0},{"description":"E28: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/PointerEventsExample.js","lineNumber":0,"column":0},{"description":"E29: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/PushNotificationIOSExample.js","lineNumber":0,"column":0},{"description":"E30: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/ResponderExample.js","lineNumber":0,"column":0},{"description":"E31: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/ScrollViewExample.js","lineNumber":0,"column":0},{"description":"E32: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/SliderIOSExample.js","lineNumber":0,"column":0},{"description":"E33: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/StatusBarIOSExample.js","lineNumber":0,"column":0},{"description":"E34: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/SwitchIOSExample.js","lineNumber":0,"column":0},{"description":"E35: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/TabBarIOSExample.js","lineNumber":0,"column":0},{"description":"E36: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/TextExample.ios.js","lineNumber":0,"column":0},{"description":"E37: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/TextInputExample.js","lineNumber":0,"column":0},{"description":"E38: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/TimerExample.js","lineNumber":0,"column":0},{"description":"E39: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/TouchableExample.js","lineNumber":0,"column":0},{"description":"E40: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/UIExplorerApp.js","lineNumber":0,"column":0},{"description":"E41: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/UIExplorerBlock.js","lineNumber":0,"column":0},{"description":"E42: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/UIExplorerList.js","lineNumber":0,"column":0},{"description":"E43: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/UIExplorerPage.js","lineNumber":0,"column":0},{"description":"E44: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/UIExplorerTitle.js","lineNumber":0,"column":0},{"description":"E45: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/VibrationIOSExample.js","lineNumber":0,"column":0},{"description":"E46: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/ViewExample.js","lineNumber":0,"column":0},{"description":"E47: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/WebViewExample.js","lineNumber":0,"column":0},{"description":"E48: \nFailure("internal error: package /Users/james/Projects/node_modules/react-native/package.json not found")","filename":"/Users/james/Projects/react-native/Examples/UIExplorer/createExamplePage.js","lineNumber":0,"column":0}]}

@mwilc0x
Copy link
Contributor

mwilc0x commented Apr 21, 2015

Try:

brew update
brew upgrade flow

@chris-alexander55
Copy link

Yes, I did. flow --version === 0.9.1. I'm up to date. Any other suggestions?

@bobeagan
Copy link

You might need to do a brew update first. Seems like 0.9.2 is latest.

@admmasters
Copy link
Contributor

I had this issue as well. Was unaware that brew had to be updated to determine the most recent flow version.

@chrisalexander55
Copy link
Author

Despite updating Flow to 0.9.2, the error persists. Is this a Flow issue or React-Native issue. No clear direction on what to do next...

@kozlowskij
Copy link

Flow upgrade worked for me.

@watsonwu9
Copy link

I had the same issue even after flow upgrade.
the error msg is
flow: Error running command cd "/Users/IAN/Desktop/yiqixie/yiqixie" && flow --json --timeout 20:
{"status":500,"message":"Flow found type errors. If you think these are wrong, make sure your flow bin and .flowconfig are up to date, or disable with --skipflow.","type":"FlowError","errors":[{"description":"E1: invariant\nDuplicate module provider","filename":"/Users/IAN/Desktop/yiqixie/yiqixie/node_modules/react-native/node_modules/react-tools/src/vendor/core/invariant.js","lineNumber":0,"column":0},{"description":" E1: current provider","filename":"/Users/IAN/Desktop/yiqixie/yiqixie/node_modules/flux/lib/invariant.js","lineNumber":0,"column":0

@davidpfahler
Copy link

I just installed react-native-cli, created a project with react-native init and updated brew and upgraded flow. flow --version says 0.10.0. I get the following error when running flow --json:

{"passed":false,"errors":[{"message":[{"descr":"undefined\nThis type is incompatible with","code":0,"path":"/Users/djpfahler/localhost/smile/node_modules/react-native/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js","line":70,"endline":70,"start":15,"end":34},{"descr":"boolean","code":0,"path":"/Users/djpfahler/localhost/smile/node_modules/react-native/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js","line":91,"endline":91,"start":62,"end":68}]},{"message":[{"descr":"undefined\nThis type is incompatible with","code":0,"path":"/Users/djpfahler/localhost/smile/node_modules/react-native/Libraries/ReactIOS/ReactIOSMount.js","line":197,"endline":197,"start":7,"end":13},{"descr":"boolean","code":0,"path":"/Users/djpfahler/localhost/smile/node_modules/react-native/Libraries/ReactIOS/ReactIOSMount.js","line":194,"endline":194,"start":59,"end":62}]}],"version":" Apr 25 2015 04:11:34"}

@jasongonzales23
Copy link

Bump. Using flow 0.10.0 as well. Same error as davidpfahler.

@chris-alexander55
Copy link

Truthfully, I was able to move beyond this error by creating the AwesomeProject, confirmed that it compiled, then mutated it accordingly for my app build-out. It appears that the entire react-native stack is very, very fragile with dependencies literally changing every day. Once you get something working use NPM shrinkwrap feature to freeze those dependencies. May the force be with you!

[cid:053B7F2F-42CB-4748-92F7-05972DA8D049]

Christopher Alexander | Principle Software Engineer, Hook & Loop

641 Avenue of the Americas, New York, NY 10011 | office: 646 336 1700 |

christopher.alexander@infor.commailto:christopher.alexander@infor.com | http://www.infor.comhttp://www.infor.com/

From: Jason <notifications@github.commailto:notifications@github.com>
Reply-To: facebook/react-native <reply@reply.github.commailto:reply@reply.github.com>
Date: Saturday, April 25, 2015 at 12:16 PM
To: facebook/react-native <react-native@noreply.github.commailto:react-native@noreply.github.com>
Cc: Christopher Alexander <chris.alexander@infor.commailto:chris.alexander@infor.com>
Subject: Re: [react-native] Flow Type Errors Examples/UIExplorer (#938)

Bump. Using flow 0.10.0 as well. Same error as davidpfahler.


Reply to this email directly or view it on GitHubhttps://github.com//issues/938#issuecomment-96233027.

@davidpfahler
Copy link

@chris-alexander55 That is certainly sound advice, but shouldn't stop anyone from reporting issue when they occur.

@jasongonzales23
Copy link

This fixed it for me:

In .flowconfig [libs] should be [library].

Carry on.

@davidpfahler
Copy link

@jasongonzales23

$ flow --json
Flow server launched for [...]
.flowconfig:23 Unsupported config section: "library"
Could not start flow server!

@jasongonzales23
Copy link

Yeah, I see the same error in terminal, but miraculously the application launches and works. So yeah, my "solution" only works by coincidence 👎

You could (and I did) put anything in there and the demo will subsequently run.

For reference, I tried the following:

[kittens]
[pygmygoats]
[ufos]

And all of them had the same result.

@christopherdro
Copy link
Contributor

This looks like the same as #912 #784.

The issue is not upgrading flow. Trying using 0.7.0 , or 0.8.0.

@jasongonzales23
Copy link

Ah, OK. Works now. This should either be fixed or documented then.

@stephendeyoung
Copy link

I'm having the same problem as @davidpfahler

I don't get any errors if I downgrade flow to 0.9.2.

@rogeryangpro
Copy link

same problem as @davidpfahler

@nicklockwood
Copy link
Contributor

I've got it working in flow 0.10 by disabling flow in UIExplorerList.js, and switching a few types to "any" in the other files it complains about.

There were a couple of genuine type errors, but it looks like the others are either bugs in the flow analyser, or it's been confused by a knock-on issue from an imported file that my flow-fu isn't strong enough to diagnose.

@gabelevi
Copy link
Contributor

Hi everyone, thanks for the reports and sorry that you guys are having trouble! I'm a member of the Flow team and we spent the last day looking into this issue. There are two problems being discussed in this issue, both regarding react-native and Flow having trouble working together. The two problems are:

  1. People are having trouble using react-native 0.4.0 with Flow v0.10.0
  2. People are experiencing other miscellaneous Flow errors

This evening we deployed react-native 0.4.1, which included the following changes:

  1. Fixed the issues that Flow v0.10.0 noticed. react-native init yourproject should no longer generate a project with Flow errors (according to Flow v0.10.0)
  2. Temporarily disabled the red-box error messages for Flow errors. Users will have to run flow manually to see Flow errors. We on the Flow team think react-native is pretty awesome and don't want to block anyone from trying it out while we figure out how to properly pin Flow versions to React.

Over the next week I'm going to try and tackle this problem of making sure that people use the right version of Flow with each version of react-native. Here are my tentative plans:

  1. Introduce an option to turn the flow checks on/off when you run your react-native app (and thus whether to show the red box)
  2. react-native init generates this .flowconfig file which configures Flow for your new project. I'm going to make the .flowconfig file specify exactly which version of Flow your project expects. That way if you're running the wrong version of Flow you'll know immediately, rather than having to guess from some strange error message
  3. I'm going to add flow-bin as a npm dependency. flow-bin is a pseudo npm package that downloads the correct binary from GitHub based on the version number and your operating system. This way the react-native packager can always use the correct version of Flow when doing it's Flow checking.

So yeah, sorry for the pain, thanks for the report, and look for some related improvements shortly!

@gabelevi
Copy link
Contributor

Closing this issue out as a duplicate of #784

@facebook facebook locked as resolved and limited conversation to collaborators May 29, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests