Open4

FlutterFlow実践メモ(OLD)

hokachanhokachan

Cloud Functionsをデプロイすると、エラーになる。
→ node を18に変更すればOKっぽい。

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

https://community.flutterflow.io/discussions/post/how-to-fix-cloud-function-deployment-errors-all-solutions-discussion-wgfMLgpLrBlmnUI

hokachanhokachan

v2を使ってみる
regionは[Default]であればデプロイできた。

helloWorld
const functions = require('firebase-functions/v2');
const admin = require('firebase-admin');
// To avoid deployment errors, do not call admin.initializeApp() in your code

exports.helloWorld = functions.https.onRequest(
  (req, res) => {
    res.send("Hello from FlutterFlow!");
  }
);