You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To ensure FlutterFlow works smoothly with your project, ensure that `[email protected]` has the following permissions in your Firebase project:
41
41
42
42
- Cloud Functions Admin
43
43
- Editor
44
44
- Service Account User
45
45
46
-
**How to Add These Permissions:**
46
+
Follow the steps below to add these permissions:
47
47
48
48
- Go to the Firebase Console and log into your account.
49
49
- Open your project and go to **Project Settings > Users and Permissions**.
50
50
- Under **Advanced Settings Permissions**, locate `[email protected]`, click **Edit**, and add the required roles.
51
51
52
-

52
+

53
53
54
-

54
+

55
55
56
56
57
-
2. Check for Function Name Mismatch
57
+
2. **Check for Function Name Mismatch**
58
58
59
59
Ensure the function name in your code exactly matches the function name defined in FlutterFlow.
60
60
61
-
For example, in this case, FlutterFlow expects `logoMaker`, but the code incorrectly uses `data`:
61
+
For example, in this case, FlutterFlow expects `logoMaker`, but the code incorrectly uses `data`.
62
62
63
63

64
64
65
65
66
-
3. Validate Custom Code for Cloud Functions
66
+
3. **Validate Custom Code for Cloud Functions**
67
67
68
68
Small mistakes in your custom Cloud Functions code can prevent deployment.
69
69
70
70
- Double-check your code for errors.
71
71
- Test locally using an IDE or Firebase CLI.
72
72
73
-

73
+

74
74
75
75
76
-
4. Verify Firebase Billing Plan (Blaze Plan Required):
76
+
4. **Verify Firebase Billing Plan (Blaze Plan Required):**
77
77
78
78
- Ensure your Firebase project is on the **Blaze Plan**, not Spark Plan.
79
79
- Check billing status on GCP. Even if Firebase shows Blaze, GCP billing issues may still block deployments.
80
80
81
81
82
-
5. Check if Other Cloud Functions Are Deploying:
82
+
5. **Check if Other Cloud Functions Are Deploying:**
83
83
84
84
- If some Cloud Functions (like Push Notification or Stripe) are deploying successfully, it indicates your Firebase setup is mostly correct.
85
85
- Focus on inspecting your specific function code and configuration.
86
86
87
87
88
-
6. Ensure Region Selection Matches Firebase Project:
88
+
6. **Ensure Region Selection Matches Firebase Project:**
89
89
90
90
- The region set for your Cloud Function in FlutterFlow should match your Firebase project's region.
91
91
- Do not leave the region as `[default]`.
92
92
93
-

93
+

94
94
95
-

95
+

96
96
97
97
:::tip
98
98
If you previously deployed functions in the wrong region, delete them, set the correct region, and re-deploy.
99
99
:::
100
100
101
-
7. Protocol Conflicts: HTTP vs Callable Functions
101
+
7. **Protocol Conflicts: HTTP vs Callable Functions**
102
102
103
103
If you initially deployed a function as HTTP and later try to redeploy it as Callable (or vice versa), you'll get this error:
104
104
105
105
`[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.`
106
106
107
-
**Solution:**
107
+
Follow the steps below to fix this error:
108
108
109
109
- Delete the existing function in Firebase Console.
110
110
- Modify the protocol type in FlutterFlow.
111
111
- Redeploy the function.
112
112
113
-
8. Verify `package.json` Integrity
113
+
8. **Verify `package.json` Integrity**
114
114
115
115
- Use the generated `package.json` file as-is unless you need to add extra packages.
116
116
- Ensure it’s not blank and doesn’t contain invalid characters.
117
117
118
-
**Recommended structure:**
118
+
**Recommended structure:**
119
119
120
-
```json
121
-
{
122
-
"name": "functions",
123
-
"description": "Firebase Custom Cloud Functions",
124
-
"engines": {
125
-
"node": "18"
126
-
},
127
-
"main": "index.js",
128
-
"dependencies": {
129
-
"firebase-admin": "^11.8.0",
130
-
"firebase-functions": "^4.3.1"
131
-
},
132
-
"private": true
133
-
}
134
-
```
120
+
```js
121
+
{
122
+
"name": "functions",
123
+
"description": "Firebase Custom Cloud Functions",
124
+
"engines": {
125
+
"node": "18"
126
+
},
127
+
"main": "index.js",
128
+
"dependencies": {
129
+
"firebase-admin": "^11.8.0",
130
+
"firebase-functions": "^4.3.1"
131
+
},
132
+
"private": true
133
+
}
134
+
```
135
135
136
136
137
-
9. Ensure Packages Are Included in `package.json`
137
+
9. **Ensure Packages Are Included in `package.json`**
138
138
139
139
If you are using third-party packages (e.g., `axios`), make sure they are properly added to the `dependencies` section in `package.json`:
140
140
141
141

142
142
143
143
144
-
10. Validate Third-Party Package Versions
144
+
10. **Validate Third-Party Package Versions**
145
145
146
146
The versions specified in your `package.json` should match available versions listed on **[npmjs.com](https://www.npmjs.com/package/axios?activeTab=versions)**.
147
147
148
148

149
149
150
150
151
-
11. Check for Undeployed Firebase Rules and Indexes:
151
+
11. **Check for Undeployed Firebase Rules and Indexes:**
152
152
153
153
- Incomplete Firestore rules or indexes can block function deployment.
154
154
- Make sure all rules and indexes have been deployed from FlutterFlow.
@@ -172,13 +172,13 @@ You may encounter the following errors in the FlutterFlow Builder:
172
172
- Cloud Functions may fail if execution time exceeds limits.
173
173
- Set a custom timeout duration in FlutterFlow:
174
174
175
-

175
+

176
176
177
-
For longer processing tasks, increase the timeout duration in your Cloud Function configuration.
177
+
For longer processing tasks, increase the timeout duration in your Cloud Function configuration.
178
178
179
-
Configuring Cloud Function regions in FlutterFlow can also optimize performance:
179
+
Configuring Cloud Function regions in FlutterFlow can also optimize performance:
180
180
181
-

181
+

182
182
183
183
:::note
184
184
Longer timeouts may increase Firebase costs.
@@ -190,4 +190,4 @@ Longer timeouts may increase Firebase costs.
190
190
- Use **Cloud Scheduler** to periodically invoke functions and keep them warm.
191
191
- Minimize dependencies to reduce cold start delays.
192
192
193
-
Following this comprehensive troubleshooting guide should help you resolve most issues encountered when working with Cloud Functions in FlutterFlow.
193
+
Following this comprehensive troubleshooting guide should help you resolve most issues encountered when working with Cloud Functions.
0 commit comments