Reputation: 987
I'm looking into using Flow on a project for type checking. To that end, I've made a simple flow project based on the Flow tutorial listed on their website. I have two files. One exports a couple of functions:
// @flow
export function add(num1: number, num2: number): number {
return num1 + num2;
}
export function subtract(num1: number, num2: number): number {
return num1 - num2;
}
The other imports said functions and calls them:
// @flow
import { add, subtract } from './math';
const three = add(1, 2);
const one = subtract(1, 2);
Flow seems to refuse to recognize my module import in the second file. It returns the following error:
import { add, subtract } from './math'; ^^^^^^^^ ./math. Required module not found
I have tried placing these files at both the root directory (same level as .flowconfig) and in a child folder called "src". In both cases flow complains it cannot find the module. Has anyone encountered this issue before?
Flow version: 0.63.1 OS: Windows 10
Upvotes: 1
Views: 157
Reputation: 987
I was never able to solve this one, but it has something to do with my machine configuration. Multiple other developers were able to run the posted flow code on their machines without any issue. So for those who might find this post in the future due to having the same issue, just know that there might just be a configuration problem.
Upvotes: 0