Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: move log to prevent spam in dev #361

Merged
merged 2 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .changeset/smooth-hornets-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"uploadthing": patch
---

fix: move dev-log into function scope to prevent spam
8 changes: 4 additions & 4 deletions packages/uploadthing/src/internal/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 =
Expand Down
Loading