fix: Pin Typescript to prevent new type checking. #1764
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are experiencing type checking errors with new version 4.8.2 of typescript. So we are pinning to previous version 4.7.4.
See example of errors below:
dev/src/bulk-writer.ts:583:26 - error TS2345: Argument of type 'DocumentReference' is not assignable to parameter of type 'DocumentReference'.
The types returned by 'parent.where(...).get()' are incompatible between these types.
Type 'Promise<QuerySnapshot>' is not assignable to type 'Promise<QuerySnapshot>'.
Type 'QuerySnapshot' is not assignable to type 'QuerySnapshot'.
Types of property 'docs' are incompatible.
Type 'QueryDocumentSnapshot[]' is not assignable to type 'QueryDocumentSnapshot[]'.
Type 'QueryDocumentSnapshot' is not assignable to type 'QueryDocumentSnapshot'.
Types of property 'isEqual' are incompatible.
Type '(other: DocumentSnapshot) => boolean' is not assignable to type '(other: DocumentSnapshot) => boolean'.
Types of parameters 'other' and 'other' are incompatible.
Type 'DocumentSnapshot' is not assignable to type 'DocumentSnapshot'.
The types returned by 'ref.parent.where(...).get()' are incompatible between these types.
Type 'Promise<QuerySnapshot>' is not assignable to type 'Promise<QuerySnapshot>'.
Type 'QuerySnapshot' is not assignable to type 'QuerySnapshot'.
Types of property 'docs' are incompatible.
Type 'QueryDocumentSnapshot[]' is not assignable to type 'QueryDocumentSnapshot[]'.
Type 'QueryDocumentSnapshot' is not assignable to type 'QueryDocumentSnapshot'.
The types returned by 'data()' are incompatible between these types.
Type 'unknown' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to 'unknown'.
583 return this._enqueue(documentRef, 'create', bulkCommitBatch =>
~~~~~~~~~~~
dev/src/bulk-writer.ts:623:26 - error TS2345: Argument of type 'DocumentReference' is not assignable to parameter of type 'DocumentReference'.
The types returned by 'parent.where(...).get()' are incompatible between these types.
Type 'Promise<QuerySnapshot>' is not assignable to type 'Promise<QuerySnapshot>'.
Type 'QuerySnapshot' is not assignable to type 'QuerySnapshot'.
Types of property 'docs' are incompatible.
Type 'QueryDocumentSnapshot[]' is not assignable to type 'QueryDocumentSnapshot[]'.
Type 'QueryDocumentSnapshot' is not assignable to type 'QueryDocumentSnapshot'.
Types of property 'isEqual' are incompatible.
Type '(other: DocumentSnapshot) => boolean' is not assignable to type '(other: DocumentSnapshot) => boolean'.
Types of parameters 'other' and 'other' are incompatible.
Type 'DocumentSnapshot' is not assignable to type 'DocumentSnapshot'.
The types returned by 'ref.parent.where(...).get()' are incompatible between these types.
Type 'Promise<QuerySnapshot>' is not assignable to type 'Promise<QuerySnapshot>'.
Type 'QuerySnapshot' is not assignable to type 'QuerySnapshot'.
Types of property 'docs' are incompatible.
Type 'QueryDocumentSnapshot[]' is not assignable to type 'QueryDocumentSnapshot[]'.
Type 'QueryDocumentSnapshot' is not assignable to type 'QueryDocumentSnapshot'.
The types returned by 'data()' are incompatible between these types.
Type 'unknown' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to 'unknown'.
623 return this._enqueue(documentRef, 'delete', bulkCommitBatch =>
~~~~~~~~~~~
dev/src/bulk-writer.ts:683:26 - error TS2345: Argument of type 'DocumentReference' is not assignable to parameter of type 'DocumentReference'.
The types returned by 'parent.where(...).get()' are incompatible between these types.
Type 'Promise<QuerySnapshot>' is not assignable to type 'Promise<QuerySnapshot>'.
Type 'QuerySnapshot' is not assignable to type 'QuerySnapshot'.
Types of property 'docs' are incompatible.
Type 'QueryDocumentSnapshot[]' is not assignable to type 'QueryDocumentSnapshot[]'.
Type 'QueryDocumentSnapshot' is not assignable to type 'QueryDocumentSnapshot'.
Types of property 'isEqual' are incompatible.
Type '(other: DocumentSnapshot) => boolean' is not assignable to type '(other: DocumentSnapshot) => boolean'.
Types of parameters 'other' and 'other' are incompatible.
Type 'DocumentSnapshot' is not assignable to type 'DocumentSnapshot'.
The types returned by 'ref.parent.where(...).get()' are incompatible between these types.
Type 'Promise<QuerySnapshot>' is not assignable to type 'Promise<QuerySnapshot>'.
Type 'QuerySnapshot' is not assignable to type 'QuerySnapshot'.
Types of property 'docs' are incompatible.
Type 'QueryDocumentSnapshot[]' is not assignable to type 'QueryDocumentSnapshot[]'.
Type 'QueryDocumentSnapshot' is not assignable to type 'QueryDocumentSnapshot'.
The types returned by 'data()' are incompatible between these types.
Type 'unknown' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to 'unknown'.
683 return this._enqueue(documentRef, 'set', bulkCommitBatch => {
~~~~~~~~~~~
dev/src/bulk-writer.ts:747:26 - error TS2345: Argument of type 'DocumentReference' is not assignable to parameter of type 'DocumentReference'.
The types returned by 'parent.where(...).get()' are incompatible between these types.
Type 'Promise<QuerySnapshot>' is not assignable to type 'Promise<QuerySnapshot>'.
Type 'QuerySnapshot' is not assignable to type 'QuerySnapshot'.
Types of property 'docs' are incompatible.
Type 'QueryDocumentSnapshot[]' is not assignable to type 'QueryDocumentSnapshot[]'.
Type 'QueryDocumentSnapshot' is not assignable to type 'QueryDocumentSnapshot'.
Types of property 'isEqual' are incompatible.
Type '(other: DocumentSnapshot) => boolean' is not assignable to type '(other: DocumentSnapshot) => boolean'.
Types of parameters 'other' and 'other' are incompatible.
Type 'DocumentSnapshot' is not assignable to type 'DocumentSnapshot'.
The types returned by 'ref.parent.where(...).get()' are incompatible between these types.
Type 'Promise<QuerySnapshot>' is not assignable to type 'Promise<QuerySnapshot>'.
Type 'QuerySnapshot' is not assignable to type 'QuerySnapshot'.
Types of property 'docs' are incompatible.
Type 'QueryDocumentSnapshot[]' is not assignable to type 'QueryDocumentSnapshot[]'.
Type 'QueryDocumentSnapshot' is not assignable to type 'QueryDocumentSnapshot'.
The types returned by 'data()' are incompatible between these types.
Type 'unknown' is not assignable to type 'T'.
'T' could be instantiated with an arbitrary type which could be unrelated to 'unknown'.
747 return this._enqueue(documentRef, 'update', bulkCommitBatch =>
~~~~~~~~~~~
dev/src/write-batch.ts:198:7 - error TS2345: Argument of type 'WithFieldValue' is not assignable to parameter of type 'WithFieldValue'.
Type 'T' is not assignable to type 'WithFieldValue'.
Type 'T' is not assignable to type '{ [x: string]: any; }'.
198 data as firestore.WithFieldValue
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dev/src/write-batch.ts:192:10
192 create(
~
This type parameter might need an
extends { [x: string]: any; }
constraint.dev/src/write-batch.ts:192:10
192 create(
~
This type parameter might need an
extends firestore.WithFieldValue<firestore.DocumentData>
constraint.dev/src/write-batch.ts:339:50 - error TS2345: Argument of type 'T' is not assignable to parameter of type 'WithFieldValue'.
Type 'T' is not assignable to type '{ [x: string]: any; }'.
339 firestoreData = ref._converter.toFirestore(data as T);
~~~~~~~~~
dev/src/write-batch.ts:323:7
323 set(
~
This type parameter might need an
extends { [x: string]: any; }
constraint.dev/src/write-batch.ts:323:7
323 set(
~
This type parameter might need an
extends firestore.WithFieldValue<firestore.DocumentData>
constraint.dev/src/write-batch.ts:490:24 - error TS2769: No overload matches this call.
Overload 1 of 2, '(o: { [s: string]: unknown; } | ArrayLike): [string, unknown][]', gave the following error.
Argument of type 'UpdateData' is not assignable to parameter of type '{ [s: string]: unknown; } | ArrayLike'.
Type 'T | (T extends {} ? { [K in keyof T]?: FieldValue | UpdateData<T[K]> | undefined; } & UnionToIntersection<{ [K in keyof T & string]: ChildUpdateFields<K, T[K]>; }[keyof T & string]> : Partial<...>)' is not assignable to type '{ [s: string]: unknown; } | ArrayLike'.
Type 'Primitive & T' is not assignable to type '{ [s: string]: unknown; } | ArrayLike'.
Type 'undefined & T' is not assignable to type '{ [s: string]: unknown; } | ArrayLike'.
Type 'undefined & T' is not assignable to type 'ArrayLike'.
Type 'UpdateData' is not assignable to type 'ArrayLike'.
Type 'T | (T extends {} ? { [K in keyof T]?: FieldValue | UpdateData<T[K]> | undefined; } & UnionToIntersection<{ [K in keyof T & string]: ChildUpdateFields<K, T[K]>; }[keyof T & string]> : Partial<...>)' is not assignable to type 'ArrayLike'.
Type 'Primitive & T' is not assignable to type 'ArrayLike'.
Type 'undefined & T' is not assignable to type 'ArrayLike'.
Overload 2 of 2, '(o: {}): [string, any][]', gave the following error.
Argument of type 'UpdateData' is not assignable to parameter of type '{}'.
Type 'T | (T extends {} ? { [K in keyof T]?: FieldValue | UpdateData<T[K]> | undefined; } & UnionToIntersection<{ [K in keyof T & string]: ChildUpdateFields<K, T[K]>; }[keyof T & string]> : Partial<...>)' is not assignable to type '{}'.
Type 'Primitive & T' is not assignable to type '{}'.
Type 'undefined & T' is not assignable to type '{}'.
490 Object.entries(dataOrField as firestore.UpdateData).forEach(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 7 errors in 2 files.