-
Notifications
You must be signed in to change notification settings - Fork 66
Closed
Description
When running the code
import { serve } from '@hono/node-server'
import { Hono } from 'hono'
import { etag } from 'hono/etag'
const app = new Hono()
app.use(etag())
app.get('/', (c) => c.body(Buffer.from('Hello Hono!')))
serve({ fetch: app.fetch })
and running curl localhost:3000
, the server crashes:
node:internal/buffer:961
super(bufferOrLength, byteOffset, length);
^
TypeError: Cannot perform Construct on a detached ArrayBuffer
at new Uint8Array (<anonymous>)
at new FastBuffer (node:internal/buffer:961:5)
at Function._uint8ArrayToBuffer (node:stream:144:10)
at _write (node:internal/streams/writable:477:22)
at Writable.write (node:internal/streams/writable:508:10)
at ServerResponse._writeRaw (node:_http_outgoing:443:17)
at ServerResponse._send (node:_http_outgoing:420:15)
at write_ (node:_http_outgoing:1018:15)
at ServerResponse.end (node:_http_outgoing:1102:5)
at responseViaResponseObject (/Users/mruder/git-repos/hono-buffer/node_modules/@hono/node-server/dist/index.js:392:16)
Metadata
Metadata
Assignees
Labels
No labels