Search code examples
firebaseflutterdeploymentweb-deploymentflutter-web

Could not detect language for functions at functions


After firebase deploy in flutter web I get this error: error

In this answer person recommends firebase init, but I already have Firebase in the app. Thanks for any ideas!


Solution

  • I came across this issue with a custom build process and pointing only to my dist folder.

    There are three requirements for a successful build:

    1. a firebase.json with functions.source pointing to a directory containing a package.json
    2. The package.json containing a "main":"path-to-index.js" field.
    3. A node engine specified in either the package.json or firebase.json
    //firebase.json
    {
      "functions": {
        "source": "./some-dir"
      }
    }
    //some-dir/package.json
    {
      "main": "lib/index.js",
      "engines": {
        "node": "16"
      }
    }