Next.js Discord

Discord Forum

generateStaticParams

Unanswered
walid-mos posted this in #help-forum
Open in Discord
Hello,

I am trying to use differente locales in my actual project, followed Next doc + their example https://github.com/vercel/next.js/blob/canary/examples/app-dir-i18n-routing/

My getStaticParams is called, but rootLayout does receive nothing from it, the underlying problem is that it forces then to have only SSR and no SSG pages.

I used a workaround, by calling getStaticParams in a layout in /[lang], but it is redondant and i still get incorrect html with no lang attribute.

7 Replies

As you can see, in [lang] Layout getStaticParams works fine
It’s what i figured out but that’s really weird as it’s what the actual doc example does …
@walid-mos It’s what i figured out but that’s really weird as it’s what the actual doc example does …
in the official doc example, they have several root layouts
app/
  [lang]/
    layout.tsx <- root layout
    page.tsx

there is no app/layout.tsx
that's why it works
Ow you can do that ??? That’s my bad then
Thanks a lot i will try this out