Firebase "Error occurred while parsing your function triggers" in CI
The CLI ran your functions entry point to read the exported triggers and the module threw. The stack trace that follows points at the exact import or top-level statement that failed on the runner.
What this error means
A functions deploy fails with "Error: Error occurred while parsing your function triggers." followed by a Node stack trace.
Error: Error occurred while parsing your function triggers.
Error: Cannot find module 'firebase-admin'Common causes
A dependency is missing in the functions folder
Dependencies were not installed in the functions directory, so an import throws "Cannot find module" while parsing triggers.
A required environment variable is read at load time
Top-level code that reads an unset variable throws before any trigger is registered.
How to fix it
Install dependencies in the functions directory
- Install with
--prefix functionsso the functions folder has its own node_modules. - Build if using TypeScript.
- Then deploy.
npm --prefix functions ci
npm --prefix functions run build
firebase deploy --only functions --project my-projectDefer config reads into handlers
Move required config reads inside the function body so parsing triggers does not throw.
How to prevent it
- Install functions dependencies in the
functionsfolder, not just the repo root. - Avoid throwing at module load for missing config.
- Pin the functions Node version to match the runtime.