xdxd#5555 / hanya
Queries work but mutations do not
Odd bug I'm experiencing with TRPC + react-query + the koa adapter. I just set everything up per docs. I tried out a test query and a test mutation, both with very simple input validated by Zod. The query hits the backend route but the mutation never does - even if I change the inputs, etc. Does anyone have any idea where to look for the culprit here?
5 replies
Adding clerk auth object to createServerSideHelpers
So I followed clerk's docs for TRPC (https://clerk.com/docs/nextjs/trpc) and I added
auth
to the context
object. This works great for most requests I've made, but I'm having trouble now that I'm trying to use getStaticProps
and createServerSideHelpers
.
I slightly changed the AuthContext
type so that auth
can be undefined
, which would make sense when the page is generated at build. But is there a way to get auth info in there, when the page gets regenerated later as a user visits? Or would I need to make any auth-related stuff part of the client code?
Snippet:
4 replies
Call retries were exceeded with ssg
I'm running a
create-t3-app
on Node 18.
Has anyone seen errors trying to use SSG with TRPC and Prisma? I'm new to the T3 stack overall so I'm not sure if the error really comes down to Next, Prisma, or TRPC here. But when I try building with the code below, I'll run into Error: Call retries were exceeded
, coming from, of all things, next/dist/compiled/jest-worker/index.js
, which I thought was super weird. Not sure how this could be related to Jest.
There are 1204 cats, so I'm trying to generate 1204 pages here, so maybe that's just too much? I noticed that if I add take: 10
to getStaticPaths
, then I don't see this error anymore. But on the other hand, all I'm trying to do to generate each one is just a simple db query. TBH I would have this expected to scale to as many pages as I need to generate here.
The error:
3 replies