How to pass headers from serverActions in Next.js App router.
I'm using tRPC with Clerk auth provider in Next.js App directory. I created a
Attached error and my file structure.
serverClient to use tRPC on server-side but the context is complaining about not having request headers, it throws this even on building my application.Attached error and my file structure.


Solution
Resolved it by moving clerk
auth() to tRPC middleware with that server don't need to pass or the inner context doesn't need to have Clerk auth() as it doesn't depend on req or res objects.