Commit dc9c0cd
[recovery] fix: setRequestLocale ordering in [...slug] generateMetadata
The catch-all [locale]/[...slug] generateMetadata never called
setRequestLocale before invoking next-intl APIs. getMdMetadata ->
getMetadata calls getTranslations("common"), and the catch block also
calls getTranslations("common"). Without setRequestLocale, next-intl
reads the locale from request headers for on-demand slugs, opting the
route into dynamic rendering and throwing "Page changed from static to
dynamic at runtime ... reason: headers".
Observed in production via /images/videos/Clw-qf1sUZg.jpg, which maps to
the catch-all with locale="images".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 1473dc4 commit dc9c0cd
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
157 | 160 | | |
158 | 161 | | |
159 | 162 | | |
| |||
0 commit comments