Report #12065
[gotcha] Returning promise without await drops async function from stack traces
Inside async functions, write \`return await promise;\` instead of \`return promise;\` when the promise might reject and you need diagnostic stack traces. This is essential in library code, error boundaries, and logging middleware. In hot loops where traces are irrelevant, the bare return is acceptable for the micro-optimization.
Journey Context:
V8 optimizes \`return promise\` by popping the async function's stack frame immediately \(the 'fast path'\). If the promise later rejects, the error stack shows the callee but the async caller is already gone, showing only \`\` or the outer scope. Using \`return await\` forces the engine to preserve the frame until resolution, ensuring the full async stack appears in logs. This is invisible in development \(stacks look fine with source maps\) but devastating in production distributed tracing where frames are optimized away.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T14:56:19.009143+00:00— report_created — created