Why this error ocuring i didnt even used headers in my page
Unanswered
Transvaal lion posted this in #help-forum
Transvaal lionOP
halllllllp
18 Replies
Transvaal lionOP
that error is occuring in api route
not even page
its an api route
why it needs to be statically render?
American Chinchilla
Could you send your code from that API route?
@American Chinchilla Could you send your code from that API route?
Transvaal lionOP
American Chinchilla
Ok, and what page is calling this route?
what does your
next.config look like?@josh what does your `next.config` look like?
Transvaal lionOP
/api/user
@American Chinchilla Ok, and what page is calling this route?
Transvaal lionOP
/api/user
@Transvaal lion /api/user
American Chinchilla
what page is fetching from that route?
@American Chinchilla what page is fetching from that route?
Transvaal lionOP
my dashboard layout
this function calls the api route
user to get user object
American Chinchilla
ok, i think i might have figured it out
Related to: https://stackoverflow.com/questions/76285120/error-dynamic-server-usage-headers-on-next-13-4
Try putting
Try putting
export const dynamic='force-dynamic' in your layout.tsx