-
Notifications
You must be signed in to change notification settings - Fork 186
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
feat(trpc-server): use c.body to create response to avoid header loss #517
Conversation
🦋 Changeset detectedLatest commit: 69a6e7a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
1d3feea
to
e5c69b4
Compare
Thank you for the PR. Can you see the error on the CI? |
I didn't get this error while developing. Turns out I was using node 20, I was able to reproduce the errors in node 18. The fix for it is to update hono dep in the package to |
e5c69b4
to
fd96dce
Compare
fd96dce
to
69a6e7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks! Looks good. Updating Hono to |
Thank you so much, was just struggling with this issue! |
It seems setting multiple cookies at once does not work, I've created a PR in the main project to try and fix this. |
in
trpc-server
middleware, we currently return the response directly which causes the respose to loose information about context. So if we set a header/cookie inside a trpc route, we don't get that in the respose.I have fixed it by creating a new response object with
c.body
and returning that.A reproduction of the issue can be found at https://github.com/BlankParticle/hono-header-reproduction/tree/main