I have two projects with similar Cloud Functions setup, both directly using Typescript setup (no Webpack) similar to this example or this one
One of them uses Firestore, other one doesn't. The one that does not use Firestore compiles and deploys with no error.
However the one with Firestore functions gives me this error on tsc compile:
../node_modules/@types/googlemaps/index.d.ts(33,29): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(37,19): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(54,28): error TS2304: Cannot find name 'Node'.
../node_modules/@types/googlemaps/index.d.ts(787,30): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(798,36): error TS2304: Cannot find name 'Node'.
../node_modules/@types/googlemaps/index.d.ts(811,26): error TS2304: Cannot find name 'Node'.
../node_modules/@types/googlemaps/index.d.ts(1135,20): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1136,22): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1137,18): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1138,22): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1139,23): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1140,23): error TS2304: Cannot find name 'Element'.
../node_modules/@types/googlemaps/index.d.ts(1141,29): error TS2304: Cannot find name 'Element'.
... and goes on.
These are package.json dependencies:
"dependencies": {
"@google-cloud/storage": "^1.5.0",
"axios": "^0.17.1",
"child-process-promise": "^2.2.1",
"firebase-admin": "~5.5.1",
"firebase-functions": "^0.7.3"
},
"devDependencies": {
"typescript": "^2.6.2"
},
and content of the tsconfig:
{
"compilerOptions": {
"lib": ["es6", "es2015.promise"],
"module": "commonjs",
"noImplicitAny": false,
"outDir": "build",
"sourceMap": true,
"target": "es6"
},
"include": [
"src/**/*.ts"
],
"exclude": [
"node_modules"
]
}
What am I missing? Is it related to Typescript version? (2.6) Do I need to import a @types? Adding dev-dependency @types/node did not help.