Commit 6478b4a
[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 6478b4a
1 file changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
157 | 164 | | |
158 | 165 | | |
159 | 166 | | |
| |||
0 commit comments