Skip to content
Latchkey

Firebase "Cannot understand what targets to deploy/serve" in CI

The CLI could not map your deploy request to any configured product. Either firebase.json defines nothing to deploy, or the --only filter names a product or target that is not in the config.

What this error means

A deploy fails with "Error: Cannot understand what targets to deploy/serve. No targets in firebase.json match ...".

firebase
Error: Cannot understand what targets to deploy/serve.

No targets in firebase.json match '--only functions'.

Common causes

firebase.json does not configure the requested product

Running --only functions when firebase.json has no functions block leaves the CLI with nothing to deploy.

A typo in the --only filter

The filter names a product or target that does not exist in the config, so no target matches.

How to fix it

Add the product to firebase.json

  1. Confirm the product you deploy is configured in firebase.json.
  2. Add the missing block, for example hosting or functions.
  3. Re-run with an --only filter that matches the config.
firebase.json
{
  "hosting": { "public": "dist" },
  "functions": { "source": "functions" }
}

Match the --only filter to configured targets

Deploy only what exists, using the exact product or product:target name from the config.

Terminal
firebase deploy --only hosting --project my-project

How to prevent it

  • Keep firebase.json in the working directory the deploy runs from.
  • Use --only filters that match configured products or targets.
  • Commit firebase.json so CI deploys the same config you test locally.

Frequently asked questions

What causes ""Cannot understand what targets""?
Running --only functions when firebase.json has no functions block leaves the CLI with nothing to deploy.
How do I fix "Cannot understand what targets"?
Add the product to firebase.json

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card