Issue in Firebase authentication

I am following Redwood’s Firebase authentication official guide but I am running into the following error.

 Error: Exception in getAuthenticationContext: The default Firebase app does not exist. Make sure you call initializeApp() before using any of the Firebase services.
api | 
api | 👉 Heads up
api | 
api | The firebase app that the auth decoder is using wasn't initialized, which usually means that you have two different versions of firebase-admin.
api | Make sure that you only have one version of firebase-admin: `yarn why firebase-admin`
api | 
api |     at onContextBuilding (/home/garp/com.ganesshkumar/my-app/node_modules/@redwoodjs/graphql-server/dist/plugins/useRedwoodAuthContext.js:30:15)
api |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
api |     at async Object.contextFactory (/home/garp/com.ganesshkumar/my-app/node_modules/@envelop/core/cjs/orchestrator.js:206:45)
api |     at async processRequest (/home/garp/com.ganesshkumar/my-app/node_modules/graphql-yoga/cjs/process-request.js:46:26)
api |     at async YogaServer.getResultForParams (/home/garp/com.ganesshkumar/my-app/node_modules/graphql-yoga/cjs/server.js:269:26)
api |     at async handle (/home/garp/com.ganesshkumar/my-app/node_modules/graphql-yoga/cjs/server.js:324:25)
api |     at async handlerFn (/home/garp/com.ganesshkumar/my-app/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js:92:24)
api |     at async execFn (/home/garp/com.ganesshkumar/my-app/node_modules/@redwoodjs/graphql-server/dist/functions/graphql.js:148:16)
api |     at async requestHandler (/home/garp/com.ganesshkumar/my-app/node_modules/@redwoodjs/api-server/dist/bin.js:206:34)

and the getCurrentUser function always returns null.
The header contains the correct Bearer token in Authorization header.

In the api workspace I see the following code

const adminApp = admin.initializeApp({
  projectId: process.env.FIREBASE_PROJECT_ID

in api/src/lib/auth.ts file which means that this is getting initialized. What am I missing?

Hmm is there any more info you can provide the only thing I see that could potential be an issue is the FIREBASE_PROJECT_ID secret is not available or something so when it tries to connect it doesn’t know what to do

One thing I can think of @KrisCoulson @ganesshkumar is that the versions of firebase-admin could be different between your project and the framework; we ran into this a while ago in this thread here:

Could you run yarn why firebase-admin and see if that’s the case @ganesshkumar?

@KrisCoulson There isn’t much in my app except the default code that was created by the rw generate tools. One thing to note is that I had upgraded the redwoodjs to 7 before running into the issue. As @dom pointed out, I will check for the versions of firebase-admin and post my updates here.