Async Lambda Returning Void (ARCH3027)
Esta página aún no está disponible en tu idioma.
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.
Incorrect
Section titled “Incorrect”items.forEach(async (item) => { await save(item); // forEach never awaits, errors are lost});Correct
Section titled “Correct”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(...)).