Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"@types/html-validator": "5.0.3",
"@types/http-proxy": "1.17.3",
"@types/jest": "29.5.5",
"@types/node": "20.12.3",
"@types/node": "20.14.7",
"@types/node-fetch": "2.6.1",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]",
Expand Down Expand Up @@ -234,7 +234,7 @@
"tree-kill": "1.2.2",
"tsec": "0.2.1",
"turbo": "2.0.3",
"typescript": "5.3.3",
"typescript": "5.5.2",
"unfetch": "4.2.0",
"wait-port": "0.2.2",
"webpack": "5.90.0",
Expand All @@ -247,7 +247,7 @@
"webpack": "5.90.0",
"browserslist": "4.22.2",
"caniuse-lite": "1.0.30001579",
"@types/node": "20.12.3",
"@types/node": "20.14.7",
"@babel/core": "7.22.5",
"@babel/parser": "7.22.5",
"@babel/types": "7.22.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/app-render/action-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async function createForwardedActionResponse(
const fetchUrl = new URL(`${origin}${basePath}${workerPathname}`)

try {
let body: BodyInit | AsyncIterable<any> | undefined
let body: BodyInit | ReadableStream<Uint8Array> | undefined
if (
// The type check here ensures that `req` is correctly typed, and the
// environment variable check provides dead code elimination.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,8 @@ export async function streamToBuffer(
): Promise<Buffer> {
const buffers: Buffer[] = []

// @ts-expect-error TypeScript gets this wrong (https://nodejs.org/api/webstreams.html#async-iteration)
for await (const chunk of stream) {
buffers.push(chunk)
buffers.push(Buffer.from(chunk))
}

return Buffer.concat(buffers)
Expand All @@ -101,7 +100,6 @@ export async function streamToString(
const decoder = new TextDecoder('utf-8', { fatal: true })
let string = ''

// @ts-expect-error TypeScript gets this wrong (https://nodejs.org/api/webstreams.html#async-iteration)
for await (const chunk of stream) {
string += decoder.decode(chunk, { stream: true })
}
Expand Down
11 changes: 6 additions & 5 deletions packages/next/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"extends": "../../tsconfig-tsec.json",
"compilerOptions": {
"strict": true,
"module": "esnext",
"target": "ES2017",
"stripInternal": true,
"esModuleInterop": true,
"moduleResolution": "node",
"skipDefaultLibCheck": true,
"verbatimModuleSyntax": true,
"jsx": "react-jsx",
"stripInternal": true,
"verbatimModuleSyntax": true
"module": "ESNext",
"target": "ES2018",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically no change but target ES2017 -> ES2018, sorry for moving around order. 😅

Why?

why_tsconfig_target_es2018

"moduleResolution": "node"
},
"exclude": [
"dist",
Expand Down
Loading