Cloud function for Firebase deploy in TypeScript failed?

matti peter

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.

Frank van Puffelen

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.

edited at
0

Comments

0 comments
Login to comment

Related

Delete a Firebase Cloud Function which failed with `Deploy Error: undefined`

GCP deploy cloud function failed

Firebase cloud function deploy error

Deploy individual Cloud Function for Firebase

React + Firebase Cloud Functions in Typescript fails to deploy

firebase cloud function timeout and deploy using flutter

firebase cloud function deploy glob error

Invalidate Firebase cache for Google Cloud Function on deploy

Firebase Cloud Function deploy tslint error

Flutter firebase cloud function typescript

Unable to deploy a firebase function using Typescript and Puppeteer

Error calling a TypeScript function in firebase cloud function

Firebase deployng Sapper app as cloud function failed

Firebase Cloud Function - Reference.update failed

GCP slack tutorial 'slash command'; failed to deploy google cloud function

Firebase functions failed to deploy

Firebase deploy failed even without changing the function from onCallable to onRequest

code not deploy on firebase cloud

If I do 'firebase deploy' to deploy only one new cloud function will the earlier cloud functions that were deployed be erased?

Firebase Cloud Functions deploy async function with NPM 8

Deploy Only Single Non-exported Function in Firebase Cloud Functions

How can I deploy a single Firebase Cloud Function in a group and a region?

Error on deploy Firebase cloud function Each then() should return a value or throw

How to deploy firebase cloud function dependencies require js

Error when I deploy cloud function Firebase/Stripe

Deploy firebase cloud functions - Invalid function service account

Failed to create function project when deploying firebase cloud function

Failed to deploy Cloud Endpoint with OpenApi

Firebase Deploy Error: Authorization failed