Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Functions did not deploy properly

Functions deploy had errors. To continue deploying other features (such as database), run:

firebase deploy --except functions

Error:

Functions did not deploy properly.

like image 615
Mario Avatar asked May 19 '17 10:05

Mario


5 Answers

Try running deploy with --debug. For example: firebase --debug deploy.

In my case the function looked like this:

exports.test = functions.firestore.document('chats').onCreate((snap, context) => {
   ...
});

The debug log contained the following error message:

fieldViolations=[field=event_trigger, description=Expected value chats to match regular expression [^/]+/[^/]+(/[^/]+/[^/]+)*]]

And that's when I realized that chats is not a document but a collection. I changed the path to that of the collection and everything worked fine.

EDIT:

To view more logs you can also try:

firebase functions:log

or

firebase functions:log --only <FUNCTION_NAME>

Link to documentation.

like image 131
Georgios Avatar answered Oct 16 '22 11:10

Georgios


I had the same issue with Firestore ,my problem was that the path to the document was bad. I had a slash at the beginning and the end of the path to my document like I used to do with Firebase Realtime Database path. Hope it helps someone.

like image 21
jamesthakid Avatar answered Oct 16 '22 09:10

jamesthakid


Just close whatever IDE you're using and then reopen it. Then on node redeploy your functions. This should resolve the issue.

like image 12
Junia Montana Avatar answered Oct 16 '22 10:10

Junia Montana


I got this error as well, I had the problem that a dependency was missing in the package.json file.

By running firebase --debug deploy it returned an error on the user code. firebase functions:log gave then the specifics, that a package was not included.

like image 9
seveneights Avatar answered Oct 16 '22 10:10

seveneights


I deleted yarn.lock then error goes away. I think package-lock.json and yarn.lock should not exist together.

like image 7
Roeniss Avatar answered Oct 16 '22 10:10

Roeniss