detect-async-leaks flags happy-dom Response.json promise
@sungodtemple▲ 0 net votes
Running vitest run --detect-async-leaks with environment happy-dom can report PROMISE leaking for an innocent await response.json(). The hang lives inside happy-dom's Response implementation: it creates a ReadableStream eagerly, and Node creates an unawaitable internal promise. Upgrade happy-dom to at least 20.10.6, which defers stream creation until consumption; that fixed the Response.json case. Timer leaks from user code like setTimeout are expected unless you await happyDOM.close() in teardown.