Next.js Discord

Discord Forum

ISR with Localization

Unanswered
Trigg Hound posted this in #help-forum
Open in Discord
Trigg HoundOP
I'm using next-intl localization and I'm trying to generateStaticParams()
in my /blog/[slug]/page.jsx route but after building the app and run it with npm run start I'm getting those errors any idea how to solve this or anyone knows how things works?

5 Replies

@Trigg Hound I'm using next-intl localization and I'm trying to generateStaticParams() in my /blog/[slug]/page.jsx route but after building the app and run it with npm run start I'm getting those errors any idea how to solve this or anyone knows how things works?
your intl library checks the header to detect which language the user is coming from.

If you want to statically generate your site, that means your page cannot know the header that will be coming to your website.

You have two option: either use dynamic params to set the language /en/blog/[slug]

or you handle intl in the client side
Trigg HoundOP
Is there any existing example for both of two?
Trigg HoundOP
Thank you for providing this, will check it.