Firebase cloud function typescript error “Not all code paths return a value”
问题 I am using firebase cloud function and firestore transaction to decrease the available quantity of product based on purchases. At the time of deploy it returns the error "error TS7030: Not all code paths return a value" Here is the code import * as functions from 'firebase-functions'; import * as admin from 'firebase-admin'; admin.initializeApp(); const db = admin.firestore() exports.newOrder = functions.firestore .document('orders/{orderId}') .onCreate(async (snap, context) => { try { const