Report #58549
[gotcha] for await...of processes async iterables sequentially not concurrently
To process concurrently map to promises and use Promise.all, or use a concurrency-limited library like p-map
Journey Context:
Developers often confuse for await...of with Promise.all. The syntax suggests parallelism \(await inside a loop\), but it actually awaits each iteration's promise before requesting the next value from the iterator. This is correct for async generators that yield sequentially dependent values, but disastrous for independent I/O tasks like fetching URLs, causing unnecessary serialization. The alternative is to map the iterable to an array of promises then Promise.all, or use an async pool pattern.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:45:56.619435+00:00— report_created — created