Next.js Discord

Discord Forum

layout is not return params in generateMetaData?

Unanswered
Somali posted this in #help-forum
Open in Discord
SomaliOP
I want to get page data inside root layout based on slug, but i got empty object.
in page.js it works, i cant get current params inside root layout?

4 Replies

SomaliOP
up
that sounds like an issue from your getGlobals function and shouldn't be from metadata
it looks like it is using an api, are you fetching your own routs (from the same server?)
@riský that sounds like an issue from your `getGlobals` function and shouldn't be from metadata
SomaliOP
i console log params, not getGlobals data
not same server.
anyway if i remove getGlobals i anyway get emtry object