You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The database paremeter in the DocumentOptions does only accept a string parameter. When trying to use the value returned by defineString, the function can not be deployed.
Were you able to successfully deploy your functions?
No
error TS2769: No overload matches this call.
Overload 1 of 2, '(document: string, handler: (event: FirestoreEvent<QueryDocumentSnapshot | undefined, Record<string, string>>) => any): CloudFunction<...>', gave the following error.
Argument of type '{ database: StringParam; document: string; }' is not assignable to parameter of type 'string'.
Overload 2 of 2, '(opts: DocumentOptions<"myCollection/{documentId}">, handler: (event: FirestoreEvent<QueryDocumentSnapshot | undefined, { documentId: string; }>) => any): CloudFunction<...>', gave the following error.
Type 'StringParam' is not assignable to type 'string'.
It is though possible to deploy when casting to any:
Thanks for the feature request. It will be part of this week's release (est tomorrow). You'll have to update your firebase-functions SDK, but the CLI works without changes.
Related issues
[REQUIRED] Version info
node:
21.7.0
firebase-functions:
4.7.0
firebase-tools:
13.4.1
firebase-admin:
11.8.0
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
The DocumentOptions parameters should accept
type | Expression<type>
:[REQUIRED] Actual behavior
The database paremeter in the DocumentOptions does only accept a string parameter. When trying to use the value returned by defineString, the function can not be deployed.
Were you able to successfully deploy your functions?
No
It is though possible to deploy when casting to any:
The text was updated successfully, but these errors were encountered: