Skip to content

Async Lambda Returning Void (ARCH3027)

Key typescript.async.async-void-callback · Severity warning · Category async

Passing an async arrow function where a non-awaitable (void) callback is expected means the runtime never awaits it, so its exceptions escape unobserved.

items.forEach(async (item) => {
await save(item); // forEach never awaits, errors are lost
});
for (const item of items) {
await save(item); // awaited sequentially, errors propagate
}

Use a for...of loop that awaits the async work, or collect the promises with Promise.all(items.map(...)).