Closed ottob closed 3 months ago
My code:
import { getAuth, UserRecord } from 'firebase-admin/auth'
import { FunctionBuilder, CloudFunction } from 'firebase-functions'
export default (
functions: FunctionBuilder,
config: { allowedDomains?: string[] } = {}
): CloudFunction<UserRecord> =>
functions.auth.user().onCreate(async (user, { eventId }) => {
maybe the UserRecord should be imported from somewhere else now?
Could you test using the latest Firebase Admin SDK v12.3.0
and see if that resolves your issue?
Sorry, same issue with 12.3.0
Digging into this a bit more I can see that it's 12.1.1 that broke it, not 12.2.0.
I cannot do a proper bisect, but maybe this was caused by https://github.com/firebase/firebase-admin-node/pull/2556
We have a mono repo and I hade bumped the version in once place, but forgotten in another. So then it added the new version to yarn.lock in addition to the old one, so it linked multiple versions.
[REQUIRED] Step 2: Describe your environment
[REQUIRED] Step 3: Describe the problem
when I bumped firebase-admin from 12.1.0 to 12.2.0 it stopped compiling my auth function trigger. Instead I receive a type error:
Steps to reproduce:
Create a v1 auth trigger as described here: https://firebase.google.com/docs/functions/auth-events#trigger_a_function_on_user_creation Build it.