Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Functions Deploy: Error occurred while parsing your function triggers

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

like image 946
Dimitri Avatar asked Apr 06 '18 14:04

Dimitri


1 Answers

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

Run: npm install -g firebase-tools@latest

like image 66
aTo Avatar answered Oct 21 '22 17:10

aTo