简体   繁体   中英

Could not deploy functions on firebase

After running the command line firebase deploy --only functions , I have these errors:

在此处输入图片说明

Below you may find also the logs in the firebase: 在此处输入图片说明

I tried multiple times to run the command for deploy and the logs show different messages, these the last ones:

11:13:12.563 PM
api
Error: function terminated. Recommended action: inspect logs for termination reason. Function cannot be initialized.
 
11:13:12.615 PM
api
{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","status":{"code":3,"message":"Function failed on loading user code. Error message: Error: please examine your function logs to see the error cause: https://cloud.google.com/functions/docs/monitoring/logging#viewing_logs"},"authenticationInfo":{"principalEmail":"taobardhi@gmail.com"},"serviceName":"cloudfunctions.googleapis.com","methodName":"google.cloud.functions.v1.CloudFunctionsService.UpdateFunction","resourceName":"projects/clone-react-dfee2/locations/us-central1/functions/api"}

Your error might be probably caused by a syntax code error or any other code problem.

As the error message recommends you will find further information about the error by examining the corresponding entry log in the Cloud Console:

https://cloud.google.com/functions/docs/monitoring/logging#viewing_logs

Another option would be to run your functions locally before deploying them to check if they work as expected.

I was facing similar error "code": 3 on firebase console while deploying a cloud function.

For me, adding module dependencies in package.json file with correct version numbers and running npm install (with 0 vulnerability ) worked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM