I'm developing on the t3 stack with clerk as the auth. When I try to call one of my protected endpoints, I get the following error when building
[cause]: a [Error]: Dynamic server usage: Page couldn't be rendered statically because it used `headers`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
[cause]: a [Error]: Dynamic server usage: Page couldn't be rendered statically because it used `headers`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error
I don't really understand why this error occurs when only the
auth
auth
method is being used from Clerk in the trpc context, but using
unstable_nostore
unstable_nostore
in the components that do call the endpoints, fixes this issue.