Skip to content

Commit 6e659b3

Browse files
committed
make typescript happy
1 parent cfe323e commit 6e659b3

File tree

1 file changed

+2
-1
lines changed
  • examples/pages-router/src/pages/api/streaming

1 file changed

+2
-1
lines changed

examples/pages-router/src/pages/api/streaming/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Readable } from "node:stream";
2+
import { ReadableStream } from "node:stream/web";
23
import type { NextApiRequest, NextApiResponse } from "next";
34

45
function iteratorToStream(iterator: AsyncIterator<Uint8Array>) {
@@ -46,6 +47,6 @@ export default async function handler(
4647
const iterator = makeIterator();
4748
const stream = iteratorToStream(iterator);
4849

49-
// @ts-ignore - not sure how to make typescript happy here
50+
// we need to import ReadableStream from `node:stream/web` to make TypeScript happy
5051
return Readable.fromWeb(stream).pipe(res);
5152
}

0 commit comments

Comments
 (0)