Search code examples
firebasegoogle-cloud-functionscontinuous-deploymentwebdeploy

Firebase Deployment Error "Error: Functions did not deploy properly."


I have deployed Firebase functions in the past many times. For some reasons, recently (around 2-3 days) I am frequently getting error while deployment. I am using windows to release the code. When I tried with setting up the same project in my Linux system and Mac system the deployment works correctly. What may be the issue for the release from Windows environment.

The following is the issues getting while deployment.

! functions[payment(us-central1)]: Deployment error. Function failed on loading user code. This is likely due to a bug in the 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. Additional troubleshooting documentation can be found at https://cloud.google.com/functions/docs/troubleshooting#logging. Please visit https://cloud.google.com/functions/docs/troubleshooting for in-depth troubleshooting documentation.

Functions deploy had errors with the following functions: admin cancellation cost createStripeCharge customer driver driverLiveTracking generalSettings notification order payment

To try redeploying those functions, run: firebase deploy --only "functions:admin,functions:cancellation,functions:cost,functions:createStripeCharge,functions:customer,functions:driver,functions:driverLiveTracking,functions:generalSettings,functions:notification,functions:order,functions:payment"

To continue deploying other features (such as database), run: firebase deploy --except functions

Error: Functions did not deploy properly.

Following is the deployment command I am using for

"echo Deploying Functions && npm run lint && npm run build && firebase deploy --only functions"

Please share your knowledge over the issue.

Thanks.


Solution

  • I have resolved this issue. On building, I found that the node modules and lib functions are not replacing correctly with the new build. I have done a name changing previously and that are not reflecting in the new build.

    Steps followed:

    • Removed node modules and lib files
    • Npm install
    • Npm run serve

    And a new build is worked fine as well. I got the same issue using Jenkins build also. I just manually removed the same in server also.