Next JS server Component fetch data when using clerk for authentication and Hono js For backend #4271
-
I am using next JS server component to fetch data with search params using clerk authentication package. Also, using hono JS as backend with drizzle ORM. The issue is can't fetch data in server component as clerk does not sending auth session or token in from server component when doing it on it's own for client component.
console in terminal:
backend code:
facing error:
can fetch data if I remove clerkMiddleware(), and userId check Why could not doing same in server component !!! help pls. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Okay after go through hono RPC guides I get the solution I have to send headers in another object like bellow :
or I can directly use fetch also
|
Beta Was this translation helpful? Give feedback.
Okay after go through hono RPC guides I get the solution I have to send headers in another object like bellow :
or I can directly use fetch also