Open vitorGabr opened 5 months ago
Could you share a minimal reproduction? You can use the CodeSandbox template: https://codesandbox.io/p/devbox/jovial-paper-skkprk
Saw this issue as well. Happened to me when trying to set the lang
attribute on the html
tag for the root layout (app/layout.tsx
, not inside app/[locale]/layout.tsx
). I used getCurrentLocale
and so it was triggering errors when building.
Tried to do this because Next was overriding the lang attribute when rendering the app afterwards, as their docs mention that it is required to have a root layout, but I don't have the current locale available to set that attribute.
Works fine in development though.
Happening to me as well. I have my home page like this:
And my layout.tsx like this:
A build error when building vercel with the experimental PPR: true
build: Error: Could not find locale while pre-rendering page, make sure you called
setStaticParamsLocale
at the top of your pages