From 459d05f8349758b569c0b43a8507ae2b0ee2c4cc Mon Sep 17 00:00:00 2001 From: twotalesanimation <80506065+twotalesanimation@users.noreply.github.com> Date: Sat, 1 Aug 2026 16:38:59 +0200 Subject: [PATCH] Fix type errors that failed the Docker build - Cast the transcoder upload body to node:stream/web ReadableStream; the DOM ReadableStream type lacks the async-iterator members Readable.fromWeb expects - Exclude transcoder/ and transcoder-remote/ from the root tsconfig: they are standalone sub-projects with their own tsconfig and dependencies (e.g. archiver) that aren't installed in the root node_modules, so next build's typecheck can never resolve them Co-Authored-By: Claude Fable 5 --- app/api/transcoder/upload/[videoId]/route.ts | 4 +++- tsconfig.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/api/transcoder/upload/[videoId]/route.ts b/app/api/transcoder/upload/[videoId]/route.ts index 52ee620..c6f4654 100644 --- a/app/api/transcoder/upload/[videoId]/route.ts +++ b/app/api/transcoder/upload/[videoId]/route.ts @@ -69,7 +69,9 @@ export async function POST( // 1. Stream upload body to a temp zip file on disk. const nodeReadable = Readable.fromWeb( - request.body as ReadableStream + // DOM ReadableStream and node:stream/web ReadableStream are structurally + // different types; fromWeb expects the latter + request.body as unknown as import("node:stream/web").ReadableStream ); const writeStream = fssync.createWriteStream(tempZipPath); await pipeline(nodeReadable, writeStream); diff --git a/tsconfig.json b/tsconfig.json index bfbf042..b46d8a9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -30,5 +30,5 @@ ".next/dev/types/**/*.ts", "**/*.mts" ], - "exclude": ["node_modules", "public"] + "exclude": ["node_modules", "public", "transcoder", "transcoder-remote"] }