useQuery runs on CSR?!

Hi! When I try to build my next app, the useQuery hooks from my pages are triggered and fail with TRPCError (because you have to be authenticated). I am using ssr: false and my pages don't use getStaticProps or getServerSideProps The useQuery should run only on client side as mentioned in https://nextjs.org/docs/pages/building-your-application/rendering/client-side-rendering Any idea how to debug/fix this?
const Page: NextPage = () => {
const {data} = api.test.list.useQuery()

return (<>
{data?.map(item => <p ...>{item.title}</>)
</>)

}
const Page: NextPage = () => {
const {data} = api.test.list.useQuery()

return (<>
{data?.map(item => <p ...>{item.title}</>)
</>)

}
Rendering: Client-side Rendering (CSR)
Learn how to implement client-side rendering in the Pages Router.
1 Reply
若帆 Leo
若帆 Leo16mo ago
Did u setup the auth middleware correctly
Want results from more Discord servers?
Add your server