I´m following this example from firebase. https://firebase.google.com/docs/functions/get-started
I´ve just download all the required API and had started learning.
I´m creating the functions with TypeScript, this "Hello World" https://github.com/firebase/functions-samples/blob/master/typescript-getting-started/functions/src/index.ts worked fine.
But "addMessage()" didn't.
exports.addMessage = functions.https.onRequest((req, res) => {
const original = req.query.text;
return admin.database().ref('/messages').push({original: original}).then((snapshot) => {
return res.redirect(303, snapshot.ref.toString());
});
});
It's giving this error message:
Firebase Admin SDK ERROR: Expression has type
void. Put it on its own line as a statement