Open jerryOkafor opened 5 years ago
I am getting a lot of Duplicate Identifier issues after adding pring.ts due to dependency on firebase and firebase admin.
pring.ts
node_modules/@google-cloud/firestore/types/firestore.d.ts:28:15 - error TS2300: Duplicate identifier 'DocumentData'. 28 export type DocumentData = {[field: string]: any}; ~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:35:15 - error TS2300: Duplicate identifier 'UpdateData'. 35 export type UpdateData = {[fieldPath: string]: any}; ~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:46:16 - error TS2300: Duplicate identifier 'Firestore'. 46 export class Firestore { ~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:122:16 - error TS2300: Duplicate identifier 'GeoPoint'. 122 export class GeoPoint { ~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:149:16 - error TS2300: Duplicate identifier 'Transaction'. 149 export class Transaction { ~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:266:16 - error TS2300: Duplicate identifier 'WriteBatch'. 266 export class WriteBatch { ~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:361:14 - error TS2717: Subsequent property declarations must have the same type. Property 'lastUpdateTime' must be of type 'Timestamp', but here has type 'string'. 361 readonly lastUpdateTime?: string; ~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:393:16 - error TS2300: Duplicate identifier 'WriteResult'. 393 export class WriteResult { ~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:417:16 - error TS2300: Duplicate identifier 'DocumentReference'. 417 export class DocumentReference { ~~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:557:16 - error TS2300: Duplicate identifier 'DocumentSnapshot'. 557 export class DocumentSnapshot { ~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:626:16 - error TS2300: Duplicate identifier 'QueryDocumentSnapshot'. 626 export class QueryDocumentSnapshot extends DocumentSnapshot { ~~~~~~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:653:15 - error TS2300: Duplicate identifier 'OrderByDirection'. 653 export type OrderByDirection = 'desc' | 'asc'; ~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:659:15 - error TS2300: Duplicate identifier 'WhereFilterOp'. 659 export type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>'; ~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:665:16 - error TS2300: Duplicate identifier 'Query'. 665 export class Query { ~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:873:16 - error TS2300: Duplicate identifier 'QuerySnapshot'. 873 export class QuerySnapshot { ~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:925:15 - error TS2300: Duplicate identifier 'DocumentChangeType'. 925 export type DocumentChangeType = 'added' | 'removed' | 'modified'; ~~~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:968:16 - error TS2300: Duplicate identifier 'CollectionReference'. 968 export class CollectionReference extends Query { ~~~~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:1019:16 - error TS2300: Duplicate identifier 'FieldValue'. 1019 export class FieldValue { ~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:1047:16 - error TS2300: Duplicate identifier 'FieldPath'. 1047 export class FieldPath { ~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:1073:12 - error TS2300: Duplicate identifier 'FirebaseFirestore'. 1073 export = FirebaseFirestore; ~~~~~~~~~~~~~~~~~ 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}; ~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:35:15 - error TS2300: Duplicate identifier 'UpdateData'. 35 export type UpdateData = {[fieldPath: string]: any}; ~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:101:16 - error TS2300: Duplicate identifier 'Firestore'. 101 export class Firestore { ~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:205:16 - error TS2300: Duplicate identifier 'GeoPoint'. 205 export class GeoPoint { ~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:232:16 - error TS2300: Duplicate identifier 'Transaction'. 232 export class Transaction { ~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:349:16 - error TS2300: Duplicate identifier 'WriteBatch'. 349 export class WriteBatch { ~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:475:16 - error TS2300: Duplicate identifier 'WriteResult'. 475 export class WriteResult { ~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:498:16 - error TS2300: Duplicate identifier 'DocumentReference'. 498 export class DocumentReference { ~~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:647:16 - error TS2300: Duplicate identifier 'DocumentSnapshot'. 647 export class DocumentSnapshot { ~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:716:16 - error TS2300: Duplicate identifier 'QueryDocumentSnapshot'. 716 export class QueryDocumentSnapshot extends DocumentSnapshot { ~~~~~~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:743:15 - error TS2300: Duplicate identifier 'OrderByDirection'. 743 export type OrderByDirection = 'desc' | 'asc'; ~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:749:15 - error TS2300: Duplicate identifier 'WhereFilterOp'. 749 export type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>' | 'array-contains'; ~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:755:16 - error TS2300: Duplicate identifier 'Query'. 755 export class Query { ~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:963:16 - error TS2300: Duplicate identifier 'QuerySnapshot'. 963 export class QuerySnapshot { ~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:1015:15 - error TS2300: Duplicate identifier 'DocumentChangeType'. 1015 export type DocumentChangeType = 'added' | 'removed' | 'modified'; ~~~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:1058:16 - error TS2300: Duplicate identifier 'CollectionReference'. 1058 export class CollectionReference extends Query { ~~~~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:1123:16 - error TS2300: Duplicate identifier 'FieldValue'. 1123 export class FieldValue { ~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:1184:16 - error TS2300: Duplicate identifier 'FieldPath'. 1184 export class FieldPath { ~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:1295:12 - error TS2300: Duplicate identifier 'FirebaseFirestore'. 1295 export = FirebaseFirestore; ~~~~~~~~~~~~~~~~~ node_modules/firebase/index.d.ts:600:36 - error TS2304: Cannot find name 'ServiceWorkerRegistration'. 600 useServiceWorker(registration: ServiceWorkerRegistration): void; ~~~~~~~~~~~~~~~~~~~~~~~~~ src/models/index.ts:65:10 - error TS4050: Return type of public static method from exported class has or is using name 'firebase.firestore.DocumentSnapshot' from external module "/Users/jerry/vscode/asyne/functions/node_modules/firebase/index" but cannot be named. 65 static makeSnapshot<T extends Pring.Base>(id: string, type: { new(id?: string): T }) { ~~~~~~~~~~~~ src/notifications/events.ts:74:26 - error TS2554: Expected 1 arguments, but got 2. 74 const user = await User.get(userId, User) ~~~~~~~~~~~~~~~~~~~~~~ src/notifications/events.ts:136:26 - error TS2554: Expected 1 arguments, but got 2. 136 const user = await User.get(userId, User) ~~~~~~~~~~~~~~~~~~~~~~ src/notifications/index.ts:87:9 - error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((documentRef: DocumentReference, precondition?: Precondition) => WriteBatch) | ((documentRef: Do...' has no compatible call signatures. 87 batch.delete(new Device(Object.keys(user.messagingTokens)[index]).reference) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/notifications/index.ts:116:23 - error TS2554: Expected 1 arguments, but got 2. 116 const owner = await User.get(business.owner.id, User) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! functions@ build: `tsc -d` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the functions@ build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/jerry/.npm/_logs/2018-10-29T22_55_22_571Z-debug.log Jerrys-MacBook-Pro:functions jerry$ npm run-script build > functions@ build /Users/jerry/vscode/asyne/functions > tsc -d ^[[Anode_modules/@google-cloud/firestore/types/firestore.d.ts:28:15 - error TS2300: Duplicate identifier 'DocumentData'. 28 export type DocumentData = {[field: string]: any}; ~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:35:15 - error TS2300: Duplicate identifier 'UpdateData'. 35 export type UpdateData = {[fieldPath: string]: any}; ~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:46:16 - error TS2300: Duplicate identifier 'Firestore'. 46 export class Firestore { ~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:122:16 - error TS2300: Duplicate identifier 'GeoPoint'. 122 export class GeoPoint { ~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:149:16 - error TS2300: Duplicate identifier 'Transaction'. 149 export class Transaction { ~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:266:16 - error TS2300: Duplicate identifier 'WriteBatch'. 266 export class WriteBatch { ~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:361:14 - error TS2717: Subsequent property declarations must have the same type. Property 'lastUpdateTime' must be of type 'Timestamp', but here has type 'string'. 361 readonly lastUpdateTime?: string; ~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:393:16 - error TS2300: Duplicate identifier 'WriteResult'. 393 export class WriteResult { ~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:417:16 - error TS2300: Duplicate identifier 'DocumentReference'. 417 export class DocumentReference { ~~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:557:16 - error TS2300: Duplicate identifier 'DocumentSnapshot'. 557 export class DocumentSnapshot { ~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:626:16 - error TS2300: Duplicate identifier 'QueryDocumentSnapshot'. 626 export class QueryDocumentSnapshot extends DocumentSnapshot { ~~~~~~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:653:15 - error TS2300: Duplicate identifier 'OrderByDirection'. 653 export type OrderByDirection = 'desc' | 'asc'; ~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:659:15 - error TS2300: Duplicate identifier 'WhereFilterOp'. 659 export type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>'; ~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:665:16 - error TS2300: Duplicate identifier 'Query'. 665 export class Query { ~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:873:16 - error TS2300: Duplicate identifier 'QuerySnapshot'. 873 export class QuerySnapshot { ~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:925:15 - error TS2300: Duplicate identifier 'DocumentChangeType'. 925 export type DocumentChangeType = 'added' | 'removed' | 'modified'; ~~~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:968:16 - error TS2300: Duplicate identifier 'CollectionReference'. 968 export class CollectionReference extends Query { ~~~~~~~~~~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:1019:16 - error TS2300: Duplicate identifier 'FieldValue'. 1019 export class FieldValue { ~~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:1047:16 - error TS2300: Duplicate identifier 'FieldPath'. 1047 export class FieldPath { ~~~~~~~~~ node_modules/@google-cloud/firestore/types/firestore.d.ts:1073:12 - error TS2300: Duplicate identifier 'FirebaseFirestore'. 1073 export = FirebaseFirestore; ~~~~~~~~~~~~~~~~~ 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}; ~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:35:15 - error TS2300: Duplicate identifier 'UpdateData'. 35 export type UpdateData = {[fieldPath: string]: any}; ~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:101:16 - error TS2300: Duplicate identifier 'Firestore'. 101 export class Firestore { ~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:205:16 - error TS2300: Duplicate identifier 'GeoPoint'. 205 export class GeoPoint { ~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:232:16 - error TS2300: Duplicate identifier 'Transaction'. 232 export class Transaction { ~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:349:16 - error TS2300: Duplicate identifier 'WriteBatch'. 349 export class WriteBatch { ~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:475:16 - error TS2300: Duplicate identifier 'WriteResult'. 475 export class WriteResult { ~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:498:16 - error TS2300: Duplicate identifier 'DocumentReference'. 498 export class DocumentReference { ~~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:647:16 - error TS2300: Duplicate identifier 'DocumentSnapshot'. 647 export class DocumentSnapshot { ~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:716:16 - error TS2300: Duplicate identifier 'QueryDocumentSnapshot'. 716 export class QueryDocumentSnapshot extends DocumentSnapshot { ~~~~~~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:743:15 - error TS2300: Duplicate identifier 'OrderByDirection'. 743 export type OrderByDirection = 'desc' | 'asc'; ~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:749:15 - error TS2300: Duplicate identifier 'WhereFilterOp'. 749 export type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>' | 'array-contains'; ~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:755:16 - error TS2300: Duplicate identifier 'Query'. 755 export class Query { ~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:963:16 - error TS2300: Duplicate identifier 'QuerySnapshot'. 963 export class QuerySnapshot { ~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:1015:15 - error TS2300: Duplicate identifier 'DocumentChangeType'. 1015 export type DocumentChangeType = 'added' | 'removed' | 'modified'; ~~~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:1058:16 - error TS2300: Duplicate identifier 'CollectionReference'. 1058 export class CollectionReference extends Query { ~~~~~~~~~~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:1123:16 - error TS2300: Duplicate identifier 'FieldValue'. 1123 export class FieldValue { ~~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:1184:16 - error TS2300: Duplicate identifier 'FieldPath'. 1184 export class FieldPath { ~~~~~~~~~ node_modules/firebase-admin/node_modules/@google-cloud/firestore/types/firestore.d.ts:1295:12 - error TS2300: Duplicate identifier 'FirebaseFirestore'. 1295 export = FirebaseFirestore; ~~~~~~~~~~~~~~~~~ node_modules/firebase/index.d.ts:600:36 - error TS2304: Cannot find name 'ServiceWorkerRegistration'. 600 useServiceWorker(registration: ServiceWorkerRegistration): void; ~~~~~~~~~~~~~~~~~~~~~~~~~
Thank you for your message.
@jerryOkafor Please update firebase-admin
firebase-admin
But I am running the latest version of Firebase Admin.
I am getting a lot of Duplicate Identifier issues after adding
pring.ts
due to dependency on firebase and firebase admin.