0
votes

When trying to deploy the template function after initialising firebase functions, I keep getting: HTTP Error: 400, The request has errors. Any ideas on what's going on?

Here's the relevant code.

export const helloWorld = functions.https.onRequest((request, response) => {
    response.send("Hello from Firebase!");
});
1

1 Answers

0
votes

Firebase does not expect named exports ( export const ...) and instead expects an exports object containing the function to run. Change it to this: exports.helloWorld = .... Furthermore, this had been a recurrent issue in the past by attempting to use older versions of the Firebase CLI. Try updating it by running npm i -g firebase-tools@latest.