You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While root page is client component, and root layout uses `unstable_setRequestLocale()`,
This error occurs in root page.
Error occurred prerendering page "/en". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `unstable_setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router-server-components#static-rendering
// app/[locale]/layout.tsxexportfunctiongenerateStaticParams(){constlocales=['en','ko','ja'];returnlocales.map(locale=>({ locale }));}exportdefaultfunctionRootLayout({ children, params }: LayoutProps<{locale: string}>){constlocale=useLocale();// Show a 404 error if the user requests an unknown localeif(params.locale!==locale)notFound();unstable_setRequestLocale(locale);return(<html> ... {children}</html>)
// app/[locale]/page.tsx'use client';exportdefaultfunctionRootPage(){// doing some token check with useEffect()return<SomeEmptyPage/>}
Mandatory reproduction URL (CodeSandbox or GitHub repository)
Description
in 3.0 rc
Mandatory reproduction URL (CodeSandbox or GitHub repository)
https://codesandbox.io/p/sandbox/next-intl-bug-template-app-forked-23pc3x
Reproduction description
Steps to reproduce:
Expected behaviour
page with client component should pass.
The text was updated successfully, but these errors were encountered: