I'm using firebase cloud functions using Typescript and every thing works fine. At my code i make one of variables of type DocumentReference
and GeoPoint
that's make vs code to import it
import { GeoPoint, DocumentReference } from '@google-cloud/firestore'
function offsetSlightly(location:GeoPoint) {
//some code here
return new GeoPoint(latitude, longitude)
}
So i need to add that node module i added using command
npm install @google-cloud/firestore
And every thing looks fine when i try to deploy i get a lot of Duplicate identifier eg DocumentData, UpdateData, GeoPoint ..etc
Error:
node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:28:15 - error TS2300: Duplicate identifier 'DocumentData'.
28 export type DocumentData = {[field: string]: any};
That's my package.json {
"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": {
"@google-cloud/firestore": "^0.14.1",
"firebase-admin": "^5.12.1",
"firebase-functions": "^1.0.4",
"nodemailer": "^4.6.4",
"twilio": "^3.16.0"
},
"devDependencies": {
"tslint": "^5.10.0",
"typescript": "^2.9.2"
},
"private": true
}
I don't know the problem but i think it's some conflict in packages.I'm android developer have a little experience in Node. Any help?