Here is my TypeScript code for cloud function in index.ts:
import * as functions from "firebase-functions";
import {SecretManagerServiceClient} from "@google-cloud/secret-manager";
const client = new SecretManagerServiceClient();
export const getSecret = functions.region('us-central1').https.onCall(async (data, context) => {
const [version] = await client.accessSecretVersion({
name: "projects/project-id/secrets/api/versions/latest",
});
const secretValue = version.payload?.data ?? "No found";
console.log(secretValue);
return secretValue;
});
After Firebase deploy
I got followings:
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run build
> build
> tsc
✔ functions: Finished running predeploy script.
i functions: preparing codebase default for deployment
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
i artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
✔ functions: required API cloudfunctions.googleapis.com is enabled
✔ artifactregistry: required API artifactregistry.googleapis.com is enabled
✔ functions: required API cloudbuild.googleapis.com is enabled
i functions: Loading and analyzing source code for codebase default to determine what to deploy
Serving at port 8200
shutdown requested via /__/quitquitquit
i functions: cleaning up build files...
✔ Deploy complete!
Project Console: https://console.firebase.google.com/project/project-id/overview
Although I saw Deploy complete, but I can not find this function in my firebase console, I do not know what's wrong, I am newbie to Typescript and cloud function, I followed tutorial and successfully deployed halloWorld.
firebaser here
This looks like a mistake in the 12.4.1 release of the Firebase CLI. Your code was deployed fine, it's just an erroneous debug log that should not be there. If you downgrade to 12.4.0, you should not encounter it.
The engineering team is working to address the fix. Once there's a bug for tracking progress in the GitHub repo, I'll share that here.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments