VI
VI6mo 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
VI6mo ago
my bad!! cloudflare works only on the edge runtime. forgot to update.
Nick
Nick6mo ago
There we go! Had a feeling it was something silly and unobvious