ansishihi
tRPC queries running on the server
Environment:
- bun 1.0.2
- next 13.4.16
- trpc 10.37.1
I am creating an app with
next-intl
and next-themes
. I initially setup trpc, and everything was working, but after a little refactoring (including i18n and dark mode), my tRPC queries suddenly run on the server.
I tried back-tracking until I got to the basic tRPC next.js setup. The only clue I had is that I changed ssr
to true
in my tRPC client, but after setting it back to false
and clearing cache, the problem still persists. Since all I have is the basic setup, I don't think looking at my code will do any good. Maybe anyone has had this problem before?
EDIT:
While trying to force the component to run on the browser, I created this dummy component:
But the console output shows up on my backend. How is it even possible that a component with useState
runs on the server?2 replies