I use the IDE WebStorm, and I'm having some difficulties coding the cloud functions. It looks like WebStorm doesn't recognize some methods/ functions/variables of firebase.
Example:
The dark red color means that it couldn't resolve the property.
As you can see, it doesn't recognize db.settings
, snapshot.data()
, db.doc()
and snapshot.id
.
My package.json (auto-generated, haven't touched anything):
{
"name": "functions",
"scripts": {
"lint": "tslint --project tsconfig.json",
"build": "tsc",
"serve": "npm run build && firebase serve --only functions",
"shell": "npm run build && firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"main": "lib/index.js",
"dependencies": {
"firebase-admin": "~6.0.0",
"firebase-functions": "^2.0.3"
},
"devDependencies": {
"tslint": "~5.8.0",
"typescript": "~2.8.3"
},
"private": true
}
What I tried so far with no success:
- Invalidate and Restart
- Reinstall node_modules
- Cancel exclusion of the package
@google-cloud
- delete
functions
andfirebase init functions
- Worked for a moment and then it failed to locate the source. - Tried to un-exclude
node_modules
just for the sake of it.
Unexcluded packages:
- @google-cloud
- @types (+ @types/*)
- firebase-admin
- firebase-functions
- tslint
- typescript
PS - I don't know if it has to do with the parent folder, but I'm using Ionic 4 in this project, while in another project I use only Angular and it behaves well (both functions folders has the exact same settings).