Skip to content

Cloud Functions Issues #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jun 27, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/troubleshooting/cloud-functions-issues/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"label": "Cloud Functions"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
keywords: ['deployment', 'error', 'cloud']
slug: /cloud-functions-troubleshooting
title: Cloud Functions Troubleshooting
---

# Cloud Functions Troubleshooting

Cloud Functions allow you to execute backend code in response to events triggered by Firebase features or HTTPS requests. This article covers common issues you might encounter when using Cloud Functions in FlutterFlow and how to resolve them.

## Deployment Errors

- **Function Name Mismatch**

Ensure that the function name in your code exactly matches the function name defined in FlutterFlow.

For example, in the screenshot below, the function name in the code is `data`, while FlutterFlow expects `logoMaker`. This mismatch will prevent successful deployment.

![](../assets/20250430121133833159.png)

- **Syntax Issues**

- Check for syntax errors in your Cloud Functions code.
- Use linting tools or the Firebase CLI to test your functions locally before deployment.
- Always validate your Firebase project configuration in FlutterFlow to ensure it's linked to the correct Firebase project ID.

- **Firebase CLI Version**

Make sure you're using the latest version of the Firebase CLI. You can update it using:


## Trigger Configuration Issues

If your Cloud Functions are not triggered as expected:

- **Review the Event Triggers:**
- For Firestore triggers, verify that the document path and collection names are correct.
- For HTTP functions, ensure your endpoints are correctly set up in FlutterFlow.

- **Check Permissions and Rules:**
- Verify that your Firebase security rules and project permissions allow the operations your Cloud Function performs. Insufficient permissions can block function execution.

## Execution Timeouts

Cloud Functions may fail if they exceed the default timeout duration.

- Set a custom timeout duration in FlutterFlow where the function is defined.

![](../assets/20250430121134186956.png)

- If your function requires more time for processing, increase the timeout setting in your Cloud Function configuration. Keep in mind that longer timeouts may increase your Firebase costs.

- You can also configure the Cloud Function regions in FlutterFlow:

![](../assets/20250430121134509618.png)

## Cold Start Delays

Cloud Functions may take longer to respond after periods of inactivity (cold starts).

- **Use Cloud Scheduler** to periodically invoke your functions, keeping them "warm" and reducing cold start times.
- **Optimize dependencies** by reducing the number and size of required packages. Large dependencies increase cold start delays.


Following these steps should help resolve most issues when working with Cloud Functions in FlutterFlow.
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
---
keywords: ['firebase', 'error', 'cloud']
slug: /flutterflow-cloud-functions-troubleshooting-guide
title: FlutterFlow Cloud Functions Troubleshooting Guide
---
# FlutterFlow Cloud Functions Troubleshooting Guide

Cloud Functions enables developers to execute backend code in response to events triggered by Firebase services (callable) and HTTPS calls.

Various situations might cause cloud functions to malfunction, often stemming from setup problems or coding mistakes within the cloud function's script.

This article guides you through common challenges with Cloud Functions in FlutterFlow.

## Errors Shown In The Builder

Occasionally, you may encounter two specific errors:

`Out of Date (Error)` or `Not Deployed (Error).`

These errors can arise from a variety of situations. If you're facing these issues, follow this troubleshooting guide designed to help you resolve them.

**Out of Date Error**

![](../assets/20250430121126719355.png)

**Not Deployed Error**

![](../assets/20250430121126936614.png)

## Key Checks for Resolving Deployment Errors

Below are essential steps to verify your project is correctly set up for cloud function deployment.

1. **Verify [email protected] has all necessary permissions**

To ensure FlutterFlow works smoothly with your project, you'll need to adjust some settings in Firebase, a tool we use in the background. Here's how you can do it,

First, we need to make sure that an email associated with FlutterFlow, which is **`[email protected]`**, has the right kind of access called `cloud function admin permission` in your Firebase project. This lets FlutterFlow do its job without any hiccups.

Besides the admin permission, we need to add a couple more types of permissions for FlutterFlow. These are called `editor` and `Service account user`.

**How to Add These Permissions**:

- Go to the Firebase website and log into your account.

- Find your project and open Project Settings.

- Inside the settings, look for a section named "Users and Permissions." That's where you can manage who has access to your project.

- You'll find an option for "Advanced Settings Permissions". Click on that. This will open Google Cloud functions, locate **[email protected]** and click on the edit button to add the permissions

![](../assets/20250430121127218829.png)

![](../assets/20250430121127501343.png)

2. **Make sure there are no errors in the custom code for Cloud Functions**

Sometimes, small mistakes in your code can stop your cloud function from being deployed. To avoid this, it's a good idea to double-check your code for any errors before you move forward.

This can be done locally on an IDE of your choice

![](../assets/20250430121127844921.png)

3. **Make Sure the Project is on Blaze Plan on Firebase**

If Cloud functions cannot be deployed, be sure to confirm if the project is in blaze plan and not spark plan,

Additionally, cross-check the logs in the console log. Sometimes, Google Cloud Platform (GCP) sends the log back to inform you that the project is in the Spark plan

In some cases, even if Firebase shows you're on the Blaze plan, there might be a billing issue on the GCP. Make sure your billing account is active and has yet to expire.

4. **Check if any other Cloud Function Deployment succeeds (Push Notification, Stripe.)**

If some of your functions are already working as expected, it means your Firebase settings are properly in place. Your next steps should be to examine the settings specific to Cloud Functions and review the code itself for any mistakes or incorrect regional settings.on

5. **Make sure the region is selected and is not left as [default] on both advanced Firebase settings and in the cloud function deployment page**

The region for the cloud function deployment should be set to the region that is set in your Firebase project setting

The region should not be left as default; this region should co-respond with all deployed cloud- functions in the project

![](../assets/20250430121128170242.png)

![](../assets/20250430121128453683.png)

In some cases, where you deployed some of the cloud functions in different regions, you will need to delete any that already exist but in the wrong region, modify the region, and then re-deploy again

6. **Different Cloud Function Protocols (HTTP VS Callable Functions)**

Suppose you had deployed the cloud function as an HTTP function. In that case, if you try to redeploy the same function as a callable function, the deployment will fail, and you will get this error `[makeUserAdmin(us-central1)] Changing from an HTTPS function to a callable function is not allowed. Please delete your function and create a new one instead`.

To resolve this, you will have to delete the cloud function in the Firebase Cloud function section and then modify the Function in FlutterFlow and re-deploy the function

7. **Verify that the package.json file is not left blank and that it doesn’t have invalid characters**

Confirm that you use the generated package.json file, and don’t make any changes to the file unless you are adding the packages.

If FlutterFlow fails to generate the file details, it is recommended to use this

```js
{
"name": "functions",
"description": "Firebase Custom Cloud Functions",
"engines": {
"node": "18"
},
"main": "index.js",
"dependencies": {
"firebase-admin": "^11.8.0",
"firebase-functions": "^4.3.1"
},
"private": true
}
```

8. **Ensure that the packages used in the cloud functions are included in the package.json file**

It's normal to forget to include third packages used in the cloud function in the package.json file. For instance, if you are using `axios`, please ensure that the package is already included in the package.json file

![](../assets/20250430121128741407.png)

9. **Cross-check that the version of the third-party library used is valid**

Check that the version of the third-party library used is valid, i.e., the version listed in the package.json file should be among the versions listed in the **[package's version archive](https://www.npmjs.com/package/axios?activeTab=versions)**.

![](../assets/20250430121129014430.png)

10. **Check for un-deployed Firebase rules**

Lastly, ensure that you have deployed your Firebase configuration settings from FlutterFlow. This includes Firestore rules and Firestore indexes.

These can block cloud function function deployment when they are still not deployed