React: Flow: Import a local js file - cannot resolve issue module

To get to ./def from ./hello.jsx, you have to go up another directory

import words from '../../words';


Got it working.

Relative paths don't really work with Flow.

We need to map imports from Project root for Flow to understand.

I changed my import to

import words from 'def/words';

Add the following to your .flowconfig file

module.name_mapper='^def\(.*\)$' -> '<PROJECT_ROOT>/src/abc/def/\1'

Fixes above error.