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 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 =