Bug Report
π Search Terms
Promise.all, Awaited
π Version & Regression Information
4.9.5
β― Playground Link
I couldn't repro this bug in the playground.
Please see this test repo instead.
π» Code
Multiple files are needed to repro this bug. See the test repo. The relevant error is:
export async function testPromiseAll(docs: string[]) {
const requests = docs.map(async doc => fetch("/doc"));
const responses = await Promise.all(requests);
for (const res of responses) {
await res.blob(); // Property 'blob' does not exist on type 'Promise<Response>'.
}
}
π Actual behavior
Code fails to build with:
Property 'blob' does not exist on type 'Promise<Response>'.
This is because the return type of Promise.all() becomes a Promise<Array<Promise<Response>>> instead of a Promise<Array<Response>>.
π Expected behavior
Code typechecks.
Bug Report
π Search Terms
Promise.all, Awaited
π Version & Regression Information
4.9.5
β― Playground Link
I couldn't repro this bug in the playground.
Please see this test repo instead.
π» Code
Multiple files are needed to repro this bug. See the test repo. The relevant error is:
π Actual behavior
Code fails to build with:
This is because the return type of
Promise.all()becomes aPromise<Array<Promise<Response>>>instead of aPromise<Array<Response>>.π Expected behavior
Code typechecks.