Webstorm cant resolve firebase 9 imports

My problem is that my IDE (WebStorm) doesn't recognize Firebase imports. It throws the following error:

Cannot resolve symbol getFirestore.

Here are my imports:

import { initializeApp, getApps } from "firebase/app";
import {
} from "firebase/auth";
import { getAnalytics } from "firebase/analytics";
import { getFirestore } from "firebase/firestore";

The code works as it should, but Webstorm just cant recognize the imports, which also means that I get to autocompletion etc...

I've tried doing "invalidate cache and restart"
I've tried deleting node_modules and package.lock.json and reinstalled everything
I have the latest Webstorm version installed

It's a Vue3 project with the default Typescript setup coming from Vue Cli

Comment actions Permalink

The @firebase module all the stuff is re-exported from is not listed as a dependency/devDependency in a package.json and thus is not indexed by default. You need marking node_modules/@firebase as Not excluded (Mark directory as/Not excluded from the folder right-click menu) to make this work

Comment actions Permalink

I havent got the possibility to mark it as not excluded ? 

Comment actions Permalink

Please try marking node_modules/@firebase and not node_modules/firebase - the latter is already indexed

Comment actions Permalink

Perfect, that worked... Thx a bunch

Comment actions Permalink

It doesn't work for firebase:9.1.3 - WebStorm 2021.2.3

It still imports from wrong source.


Please sign in to leave a comment.