c.env.incoming already piped with an await?

It's an issue i've been trying to solve for a few months now, when running this example it wont print the "Hello" text to the console, however, when removing the commented line or removing the zValidator will print the "Hello" to the console. Is the c.env.incoming already being read somewhere else?
import { HttpBindings, serve } from '@hono/node-server';
import { zValidator } from '@hono/zod-validator';
import { Hono } from 'hono';
import { z } from 'zod';

const http = new Hono<{ Bindings: HttpBindings }>();

http.post('/example', zValidator('query', z.object({ name: z.string() })), async (c) => {
await new Promise<void>((resolve) => setTimeout(() => resolve(), 1)); // Removing this line prints "Hello" to the console.

c.env.incoming.pipe(process.stdout);

return c.json({ message: 'Hello, World!' }, 200);
});

serve({
fetch: http.fetch,
hostname: 'localhost',
port: 1337,
});
import { HttpBindings, serve } from '@hono/node-server';
import { zValidator } from '@hono/zod-validator';
import { Hono } from 'hono';
import { z } from 'zod';

const http = new Hono<{ Bindings: HttpBindings }>();

http.post('/example', zValidator('query', z.object({ name: z.string() })), async (c) => {
await new Promise<void>((resolve) => setTimeout(() => resolve(), 1)); // Removing this line prints "Hello" to the console.

c.env.incoming.pipe(process.stdout);

return c.json({ message: 'Hello, World!' }, 200);
});

serve({
fetch: http.fetch,
hostname: 'localhost',
port: 1337,
});
###
POST http://localhost:1337/example?name=test HTTP/1.1
content-type: application/octet-stream

Hello
###
POST http://localhost:1337/example?name=test HTTP/1.1
content-type: application/octet-stream

Hello
1 Reply
Joydip Roy
Joydip Roy4w ago
With and without removing the promise code it's not showing any "Hello" in terminal
No description
No description
Want results from more Discord servers?
Add your server