I'm trying to deploy a GitHub repository through Firebase's apphosting on a website with NextJS 15, but I can't access the environment variables of GCP secret manager.
When I try to deploy, I get a type error like this. (it seems like I can't get the value)
Type error: Argument of type '{ apiKey: string | undefined; cookieName: string; cookieSignatureKeys: string[]; cookieSerializeOptions: { path: string; httpOnly: boolean; secure: boolean; sameSite: "strict"; maxAge: number; }; serviceAccount: { ...; }; }' is not assignable to parameter of type 'SetAuthCookiesOptions'. The types of 'serviceAccount.projectId' are incompatible between these types.
I added all the code like this to the apphosting.yaml file and also allowed access using the grantaccess command.
env:
- variable: NEXT_PUBLIC_FIREBASE_API_KEY
secret: API_KEY
availability:
- BUILD
- RUNTIME
I am referencing this code (next_public_ is in development but I am using it in deployment. Could this be a problem?)
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY