facebook / facebook/flow

Flow typechecking fail when importing via absolute path with react-native

Open
#4,186 13 comments 12 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Flow doesn't correctly resolve types when it is imported via absolute path.
I'm using react-native.

Here is an example:

![](https://media.giphy.com/media/3ohze00BxmkOOETDyw/giphy.gif)

/src/package.json (according to [this](https://medium.com/@davidjwoody/how-to-use-absolute-paths-in-react-native-6b06ae3f65d1)

```
{ "name": "@src" }
```

/.flowconfig
```
module.name_mapper='@src/helpers/verseToStrong' -> '/src/helpers/verseToStrong.js' // testing directly in case this was related with bad regexp
module.name_mapper='^@src\(.*\)$' -> '/src/\1'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.