facebook / facebook/flow

module.name_mapper to map absolute import paths no longer works

Open
#3,189 5 comments 7 reactions 0 assignees View on GitHub
module resolution
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

This .flowconfig:

```
[options]
module.system=haste
module.name_mapper='^\/\(.*\)$' -> '/src/\1'
```

used to make imports like this work:

`import Header from '/components/Header'`

Now the above setup results in errors:

```
src/components/App.jsx:5
5: import Header from '/components/Header'
^^^^^^^^^^^^^^^^^^^^ /components/Header. Required module not found

Found 1 error
```

Changing the prefix away from `/` to anything else results in the same error.

Also, in order to debug this more, is there any way to ask Flow to be more verbose about exactly where it's looking for modules?

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.