Firebase "Invalid project id" in CI
The CLI rejected the project id as invalid. Either the value is malformed (wrong characters or format), or a secret expanded to something empty or unexpected in the CI command.
What this error means
A command fails with "Error: Invalid project id: X" where X is the value passed via --project or an env variable.
firebase
Error: Invalid project id: my_project
Note: Project id must be a valid Firebase project id.Common causes
A malformed project id
Underscores, uppercase, or trailing whitespace make the id invalid; project ids are lowercase with hyphens.
An empty or wrong variable in CI
A --project ${{ env.PROJECT }} that expands to an empty or wrong value produces an invalid id.
How to fix it
Pass the exact project id
- Copy the project id from
firebase projects:listor the console. - Pass it verbatim to
--project, without quotes that add whitespace. - Confirm any env variable expands to the intended value.
Terminal
firebase projects:list
firebase deploy --project my-projectVerify the CI variable
Echo the resolved id in a debug step to confirm the secret or variable expands correctly before deploy.
How to prevent it
- Use the exact lowercase, hyphenated project id.
- Confirm CI variables expand to non-empty values before deploy.
- List projects to copy the id rather than typing it.
Related guides
Firebase "No currently active project" in CIFix Firebase "Error: No currently active project" in CI - no project was selected, so pass --project explicit…
Firebase ".firebaserc" project alias not found in CIFix Firebase "Error: Unable to use alias X, unknown project alias" in CI - the .firebaserc alias passed to --…
Firebase "Failed to get Firebase project ... permission" in CIFix Firebase "Error: Failed to get Firebase project X. Please make sure the project exists and your account h…