tRPC in getServerSideProps
this is the code im writing in the getServerSideProps
javascript
getting this error "TypeError: Cannot read properties of null (reading 'useContext')"
I enabled ssr in the utils/trpc.ts file, still same error
6 Replies
you dont use it in gssp
Christopher Ehrlich
YouTube
Advanced tRPC - Callers, functions, and gSSP
Repo for this video: https://github.com/c-ehrlich/you-dont-need-callers
If you want to use schema in the frontend, they cannot be imported from the same file as things that run specifically in the backend. One solution would be to put them into a
procedureName.schema.ts
or similar file.
tRPC:
https://trpc.io/docs
Create T3 App:
https://crea...gssp starts at like 4:30
will watch
the video appeared on my feed yesterday, was too lazy to watch it lmao. lesson learned
really nice video, i hope you keep publishing content!
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
thanks! the fakeprisma thing was just something i made up for this video https://github.com/c-ehrlich/you-dont-need-callers/blob/main/src/server/db.ts
GitHub
you-dont-need-callers/db.ts at main · c-ehrlich/you-dont-need-callers
Contribute to c-ehrlich/you-dont-need-callers development by creating an account on GitHub.