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: nextjs pages adapter response body #946

Merged
merged 4 commits into from
Sep 16, 2024
Merged

Conversation

juliusmarminge
Copy link
Collaborator

@juliusmarminge juliusmarminge commented Sep 14, 2024

res.json(response.body) resulted in {}.

couldn't find a way to forward the stream as-is, so consuming it and sending it down as JSON as a temporary workaround

Copy link

vercel bot commented Sep 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-uploadthing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 14, 2024 10:28am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
legacy-docs-uploadthing ⬜️ Ignored (Inspect) Visit Preview Sep 14, 2024 10:28am

Copy link

changeset-bot bot commented Sep 14, 2024

🦋 Changeset detected

Latest commit: e0dda6e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
uploadthing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

pkg-pr-new bot commented Sep 14, 2024

Copy link
Contributor

github-actions bot commented Sep 14, 2024

📦 Bundle size comparison

Bundle Size (gzip) Visualization
Main 25.98KB See Treemap 📊
PR (f435646) 25.98KB See Treemap 📊
Diff No change

Copy link
Contributor

A new canary is available for testing. You can install this latest build in your project with:

pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add [email protected]
pnpm add @uploadthing/[email protected]

@github-actions github-actions bot removed the release canary Trigger a canary release to npm label Sep 14, 2024
@@ -38,6 +38,7 @@ export const createRouteHandler = <TRouter extends FileRouter>(
for (const [name, value] of response.headers) {
res.setHeader(name, value);
}
return res.json(response.body);
// FIXME: Should be able to just forward it instead of consuming it first
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would be nice, but iI don't think this is a huge deal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nah lets just ship as-is and see if we ever find it high priority enough to optimize a little bit... the json blobs are never huge anyways so it's not like we're gonna load a bunch of stuff into memory

@juliusmarminge juliusmarminge merged commit 5156179 into main Sep 16, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants