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 for RN doesn't resolve ".ios" / ".android" dependencies correctly #1685

Closed
7ynk3r opened this issue Apr 19, 2016 · 4 comments
Closed

Flow for RN doesn't resolve ".ios" / ".android" dependencies correctly #1685

7ynk3r opened this issue Apr 19, 2016 · 4 comments

Comments

@7ynk3r
Copy link

7ynk3r commented Apr 19, 2016

Small bug here. If I have a file with name "SOMETHING.ios.js" and import it like

import SOMETHING from './src/components/SOMETHING'

Flow gives me the following error

./src/components/SOMETHING: ~/dev/macaron/index.ios.js:165
Required module not found

The apps works perfect.

I'm using

"dependencies": {
  "react": "^0.14.7",
  "react-native": "^0.23.1"
},
"devDependencies": {
  "flow-bin": "^0.22.1"
}
@7ynk3r 7ynk3r changed the title Flow not resolves ".ios" / ".android" dependencies correctly Flow for RN doesn't resolve ".ios" / ".android" dependencies correctly Apr 19, 2016
@abalhier
Copy link

Hello

I don't think you need to specifiy .ios (or .android) when requiring a module. React Native should resolve this for you depending on the platform it runs on. See https://github.com/fbsamples/f8app and the use of F8TabsView for example : https://github.com/fbsamples/f8app/search?utf8=%E2%9C%93&q=F8TabsView&type=Code

@7ynk3r
Copy link
Author

7ynk3r commented Apr 25, 2016

@abalhier, i know i don't need to specify .ios (or android) when requiring a module, but flow gives me an error (it can find the module). it doesn't have the logic to look for .ios / .android suffixes.

@alexanderjarvis
Copy link

Worse than this, the flow errors only show for files with an ios extension. The same code with an android.js extension doesn't show any flow errors.

@mroch
Copy link
Contributor

mroch commented May 31, 2016

duplicate of #945

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants