With source maps enabled put the following at the top of your index.ts
import 'source-map-support/register';
Then you end up with stack traces like this.
Error: Some Error
at Error (native)
at Object.<anonymous> (/user_code/src/transfers/transfer.ts:49:15)
at next (native)
at /user_code/dist/transfers/transfer.js:7:71
at __awaiter (/user_code/dist/transfers/transfer.js:3:12)
at exports.listener.functions.database.ref.onWrite (/user_code/src/transfers/transfer.ts:21:103)
at Object.<anonymous> (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:59:27)
at next (native)
at /user_code/node_modules/firebase-functions/lib/cloud-functions.js:28:71
at __awaiter (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:24:12)
at cloudFunction (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:53:36)
at /var/tmp/worker/worker.js:700:26
at process._tickDomainCallback (internal/process/next_tick.js:135:7)