VI
VI13mo ago

Drizzle query not working only inside trpc

My drizzle query works inside a regular nextjs api route. The same query running inside trpc throws an error:
TRPCClientError: Cannot read properties of undefined (reading 'prepare')
at TRPCClientError.from
TRPCClientError: Cannot read properties of undefined (reading 'prepare')
at TRPCClientError.from
I'm using Cloudflare d1 for database.
2 Replies
VI
VIOP13mo ago
my bad!! cloudflare works only on the edge runtime. forgot to update.
Nick
Nick13mo ago
There we go! Had a feeling it was something silly and unobvious

Did you find this page helpful?