Error: Could not find locale while pre-rendering page, make sure you called setStaticParamsLocale at the top of your pages.
To Reproduce (root layout file)
import { getStaticParams } from '../../locales/server'
export function generateStaticParams() {
return getStaticParams()
}
// I have added the above function in my root layout file though build is generated successfully. once i run the build with npm run start I can see Tonnes of error logs (Error: Could not find locale while pre-rendering page, make sure you called setStaticParamsLocale at the top of your pages) in all the pages.
Error: Could not find locale while pre-rendering page, make sure you called
setStaticParamsLocale
at the top of your pages.To Reproduce (root layout file) import { getStaticParams } from '../../locales/server'
export function generateStaticParams() { return getStaticParams() }
// I have added the above function in my root layout file though build is generated successfully. once i run the build with npm run start I can see Tonnes of error logs (Error: Could not find locale while pre-rendering page, make sure you called
setStaticParamsLocale
at the top of your pages) in all the pages.About