beemo
beemo4d ago

Deno + oak crashes and i dont know what makes it crash

I get the following error, running deno 2.1.1: error: Uncaught (in promise) TypeError: Cannot read headers: request closed return this.#request.headers; ^ at Object.get headerList (ext:deno_fetch/23_request.js:125:17) at Request.request.<computed> (ext:deno_fetch/23_request.js:601:60) at Request.get [headers] (ext:deno_fetch/23_request.js:260:46) at Request.get headers (ext:deno_fetch/23_request.js:481:16) at NativeRequest.get headers (https://deno.land/x/oak@v12.0.0/http_server_native_request.ts:68:26) at new Request (https://deno.land/x/oak@v12.0.0/request.ts:145:21) at new Context (https://deno.land/x/oak@v12.0.0/context.ts:173:20) at Application.#handleRequest (https://deno.land/x/oak@v12.0.0/application.ts:428:21) at Application.listen (https://deno.land/x/oak@v12.0.0/application.ts:613:28) at eventLoopTick (ext:core/01_core.js:175:7)
2 Replies
MapleLeaf 🍁
this looks like something got closed before something else had a chance to work with it, so like... a missing await? can you show the code where this happens?
beemo
beemoOP4d ago
i prefer not to share it because its a long file, So if i await all context.request.body requests the bug may disapear? could it be something else?