Axelin
DTDrizzle Team
•Created by Axelin on 8/11/2024 in #help
NEXTJS: module not found: net
hey guys, i've been trying drizzle with react query within the app router. everything works great on the server components, but it throws an error: 'module net is not defined' when i try to use the same query function on the client. ill provide some code:
this is how i create my drizzle client:
this is my query function (works on server but not on client):
this is how im fetching data on page.tsx (works fine)
this is how im fetching on client component (throws module not found error):
why does it throw an error when fetching client side? is there any way i can use the same query function server and client side? or do i have to create an api endpoint for client side fetching? thanks!
3 replies