Skip to content
Latchkey

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.

firebase
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

  1. Install with --prefix functions so the functions folder has its own node_modules.
  2. Build if using TypeScript.
  3. Then deploy.
Terminal
npm --prefix functions ci
npm --prefix functions run build
firebase deploy --only functions --project my-project

Defer 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 functions folder, not just the repo root.
  • Avoid throwing at module load for missing config.
  • Pin the functions Node version to match the runtime.

Frequently asked questions

What causes ""parsing your function triggers""?
Dependencies were not installed in the functions directory, so an import throws "Cannot find module" while parsing triggers.
How do I fix "parsing your function triggers"?
Install dependencies in the functions directory

Related guides

References

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