7

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!

Roman Soviak
  • 791
  • 2
  • 9
  • 30

1 Answers1

10

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"
  }
}
chantey
  • 4,252
  • 1
  • 35
  • 40