From 355f75696a19bfaa51631d4a7538b780e91df268 Mon Sep 17 00:00:00 2001 From: juliusmarminge Date: Sat, 16 Sep 2023 21:05:25 +0200 Subject: [PATCH 1/2] move dev log into funciton scope to stop spam --- packages/uploadthing/src/internal/handler.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/uploadthing/src/internal/handler.ts b/packages/uploadthing/src/internal/handler.ts index 32a1a11395..924b4382ea 100644 --- a/packages/uploadthing/src/internal/handler.ts +++ b/packages/uploadthing/src/internal/handler.ts @@ -64,10 +64,6 @@ const fileCountLimitHit = ( return { limitHit: false }; }; -if (process.env.NODE_ENV === "development") { - console.log("[UT] UploadThing dev server is now running!"); -} - const isValidResponse = (response: Response) => { if (!response.ok) return false; if (response.status >= 400) return false; @@ -167,6 +163,10 @@ export const buildRequestHandler = < }): Promise< UploadThingError | { status: 200; body?: UploadThingResponse } > => { + if (process.env.NODE_ENV === "development") { + console.log("[UT] UploadThing dev server is now running!"); + } + const { req, res } = input; const { router, config } = opts; const preferredOrEnvSecret = From 5af9dd7e1af71f23d83a9ec9ba1a900a052d8971 Mon Sep 17 00:00:00 2001 From: juliusmarminge Date: Sat, 16 Sep 2023 21:05:53 +0200 Subject: [PATCH 2/2] changeset --- .changeset/smooth-hornets-call.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/smooth-hornets-call.md diff --git a/.changeset/smooth-hornets-call.md b/.changeset/smooth-hornets-call.md new file mode 100644 index 0000000000..0d2e79a73d --- /dev/null +++ b/.changeset/smooth-hornets-call.md @@ -0,0 +1,5 @@ +--- +"uploadthing": patch +--- + +fix: move dev-log into function scope to prevent spam