Next.js Discord

Discord Forum

Unable to set cookies in tRPC when using app dir route handlers

Unanswered
Derock posted this in #help-forum
Open in Discord
not sure if this is a trpc issue or a next.js issue, but I have registered trpc on app/api/trpc/[trpc]/route.tsx.
in my trpc procedure, I try to set the cookie with cookies().set(...) from next/headers but it doesn't get added to the response headers. I am calling the api from the frontend.

0 Replies