IntelliJ React imported module variables are warning they're unresolved.

When I import a module in React, for example

import faker from 'faker';

when I try to call a method it doesn't seem to recognize and correctly autocomplete from the module.

 

 

2 comments
Comment actions Permalink

Try installing @types/faker.

1
Comment actions Permalink

Thanks Oksana, that totally works. I did this by adding this to my JavaScript libraries. 

I'm just curious but why do we need to do this and if there a more automated way to get this to download when installing a node module?

1

Please sign in to leave a comment.