facebook / facebook/flow

[options] module_mapper not resolving on sibling projects

Open
#6,712 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Hi there,

I have an issue with module resolution in a project, I reproduced the error in this repo: https://github.com/melloc01/flowconfig-module_mapper but it's simple so I'll try to explain:

The directory structure is like this:

```
> common/
.flowconfig
/core/
service.js
/modules/
widget.js

> project_1
.flowconfig
app.js
```

with the following **flowconfigs**:

**common**'s:
```
[options]
module.name_mapper='^core\/\(.*\)$' -> '/core/\1'
```

**project_1**'s:
```
[options]
module.name_mapper='^core\/\(.*\)$' -> '/../common/core/\1'
```

Both **common/modules/widget.js** and **project_1/app.js** have the same source code:

```js
// @flow
import service from "core/service";
```

but Flow trows an error on **project_1**, am I missing something?

---

![image](https://user-images.githubusercontent.com/4994258/43855884-553b64c2-9b1d-11e8-8126-d8a4c957c707.png)

![image](https://user-images.githubusercontent.com/4994258/43856006-a81fd2ae-9b1d-11e8-9ae0-22b34dca877f.png)

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.