-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 typechecking fail when importing via absolute path with react-native #4186
Comments
Did anyone find a solution to this? |
Didn't get any response 😢, and don't want to use relative path. This is so unfair 😞 |
By the way what editor are you using? Is that VSCode? Do you have an extension that does intellisense on absolute paths with that package.json trick? I use this extension - and created an issue there - ChristianKohler/PathIntellisense#86 |
Hey @bulby97 - it seems if you don't use the package.json trick, and instead do a absolute path from the workspace root, so |
@Noitidart nope I have an "unable to resolve module". Did you add something specific to make it work ? |
Oh you're right, I don't know what I did before, it doesn't work. I think maybe I hadn't let the flow processing intelli sense completely end (i rely on vscode extension rather then command line). |
I found a workaround for this drawing on @bulby97, #101 and https://github.com/cdebotton/react-universal/blob/master/.flowconfig: .flowconfig
Elsewhere, all of these are valid for me now (assuming
|
Thanks for sharing that awesome bit @LordParsley ! I didn't test it but it looks pretty solid! |
I had a similar problem with a new Create React App and the latest flow version. I had absolute imports from inside the src directory and @LordParsley 's solution of adding each sub folder there worked great for me:
So happy I don't need to choose between flow and absolute imports!
|
I also had a similar problem, but none of these answers were quite working for me. The main difference was that I include modules without any special namespace; e.g. I found something that worked for me over at #382, and since I found this thread when I searched for my problem, I thought it might be helpful to post it here: in
This will first check |
Thanks @BenFlanagan very much for sharing that!! |
this fixed the problem for me. |
I have a similar problem than @BenFlanagan , but in my case the imported module is on a sibling folder. This is my config:
I do't get any errors, but I don't get any intellisense or type errors either, to it makes flow useless for type checking our internal library. |
Flow doesn't correctly resolve types when it is imported via absolute path.
I'm using react-native.
Here is an example:
/src/package.json (according to this
/.flowconfig
The text was updated successfully, but these errors were encountered: