Firebase Functions Deploy: Error occurred while parsing your function triggers

14,711

It's a bug in [email protected]. Fixed in 3.18.2.

Run: npm install -g firebase-tools@latest

Share:
14,711
Dimitri
Author by

Dimitri

Focusing on Ionic and cross-platform mobile app development, Deep Learning and Neural Networks. I'm also obsessed with UX and great product design.

Updated on June 09, 2022

Comments

  • Dimitri
    Dimitri about 2 years

    I'm using Firebase Functions JavaScript version, and when I run firebase deploy, I'm getting this error:

    Error: Error occurred while parsing your function triggers.

    Error: Failed to parse app options file: Error: ENOENT: no such file or directory, open '[object Object]' at FirebaseAppError.FirebaseError

    This is my index.js code up until the line which causes this error:

    var functions = require('firebase-functions');
    var firebase = require('firebase');
    var admin = require('firebase-admin');
    
    
    var serviceAccount = require("../functions/file.json");
    
    admin.initializeApp({
        credential: admin.credential.cert(serviceAccount),
        databaseURL: "https://app.firebaseio.com"
    });
    
    var config = {
        apiKey: "key",
        authDomain: "app.firebaseapp.com",
        databaseURL: "https://app.firebaseio.com",
        projectId: "appID",
        storageBucket: "app.appspot.com",
        messagingSenderId: "number"
    };
    
    firebase.initializeApp(config);
    admin.initializeApp(functions.config().firebase);
    

    My Node version - 8.11.1

    NPM - 5.6.0

  • Doug Stevenson
    Doug Stevenson about 6 years
  • loekTheDreamer
    loekTheDreamer over 5 years
    again with this issue "firebase-admin": "~6.0.0", "firebase-functions": "^2.1.0",
  • AinisSK
    AinisSK over 5 years
    @LukeCarelsen did you fix your issue somehow?
  • loekTheDreamer
    loekTheDreamer over 5 years
    @AinisSK i cant remember... i dont think so try 3.18.2 like suggested above. sorry :P
  • sziraqui
    sziraqui over 4 years
    Add explanation to why this will solve the problem.
  • NCT 127
    NCT 127 over 3 years
    For me, it was that I had forgotten to change a function from firestore to database.
  • aTo
    aTo over 3 years
    @sziraqui It's a bug inside old version so update to the latest should fix this problem