tRPC SSG Helper w/ new Clerk middleware
So my goal is to do almost exactly what Theo does in his tutorial using the SSG helper for profile pages, but due to updated Clerk middleware I had to change my trpc.ts file.
I have my trpc.ts file set up identical to this:
https://github.com/perkinsjr/t3-app-clerk-minimal/blob/main/src/server/api/trpc.ts
There is a comment in there that says:
But I can't figure out how to use the "auth" object in the context when defining the SSG helper, it's always erroring when I try to set it up:
4 Replies
have you tried not passing anything in place of auth
because in nextauth version of SSGHelper works with session=null
Tried this, no luck because auth is required in ctx
any update on this?
a little late to the party here to be helpful, but you haven't imported or initialized the auth object, so as far as createServerSideHelpers is concerned, "auth" is just a word. you'd probably want to put
at the top of the file.