Valeriy Donika
Valeriy Donika

Reputation: 466

Flow and webpack aliases

I have troubles with flow erros.

import {Button} from "components/basics/Button";

'Module is not installed'

webpack:

resolve: {
    alias: {components: path.resolve(__dirname,'../../src/main/js/components'),}
}

flowconfig is outise the src folder

I added this to flowconfig

[options]
module.name_mapper='^components\/\(.*\)$' -> '<PROJECT_ROOT>/src/main/js/components/\1'
module.name_mapper='^components' -> '<PROJECT_ROOT>/src/main/js/components'

But it is not helps.

Application is work. No errors with the build. No errors with the flow console. But IDE highlighted my import with error. Maybe it is problem with IntelliJ?

Upvotes: 4

Views: 929

Answers (1)

Valeriy Donika
Valeriy Donika

Reputation: 466

It was not flow or webpack config problem. It was IntelliJ (Webpack) setup. So to remove this error you should do that described here

Path aliases for imports in WebStorm

Upvotes: 1

Related Questions