I am trying to run this TypeScript code snippet
import { serve } from "https://deno.land/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="eb989f8d9cdbc5dbd9dac5db">[email protected]</a>/http/server.ts"
import { pooledMap } from "https://deno.land/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a7d4d3c3e797899690948997">[email protected]</a>/async/pool.ts"
const server = serve({ port: 3000 })
async function handleRequest(request: Request) {
var res: Response = new Response("Hello, World!")
return res
}
const ress = pooledMap(
window.navigator.hardwareConcurrency - 1,
server,
req => handleRequest(req)
)
for await (const res of ress) {
res.send()
}
However, I encountered the following error:
error: Uncaught AggregateError: Threw while mapping. new AggregateError(errors, ERROR_WHILE_MAPPING_MESSAGE), ^ at https://deno.land/[email protected]/async/pool.ts:90:9
I need help in identifying the issue as the error message doesn't provide much insight other than mentioning multiple errors.