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 ...".
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
- Confirm the product you deploy is configured in
firebase.json. - Add the missing block, for example
hostingorfunctions. - Re-run with an
--onlyfilter that matches the config.
{
"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.
firebase deploy --only hosting --project my-projectHow to prevent it
- Keep
firebase.jsonin the working directory the deploy runs from. - Use
--onlyfilters that match configured products or targets. - Commit
firebase.jsonso CI deploys the same config you test locally.