Skip to content
Advertisement

Firebase fuction returning “Response is not valid JSON object.”

I am trying to send emails from a firebase function that I call from my vue app. My firebase function looks like:

JavaScript

I removed the user and pass values here. They have the correct value in my code. The vue method I use to call this function looks like:

JavaScript

When this function is called I get the following error in the console:

JavaScript

Any help would be appreciated. Thanks

Advertisement

Answer

You must a return a valid JSON result like this:

return res.status(200).json({});

Here the JSON is {} but it could be for instance something like {"status": "success}.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement