Commit f529f47
[recovery] fix: setRequestLocale ordering in wallets page (static→dynamic error)
The /wallets page (app/[locale]/wallets/page.tsx) called
getTranslations("page-wallets") before setRequestLocale(locale), and
generateMetadata never called setRequestLocale at all. For locales rendered
on-demand — e.g. a bot probe like /api/wallets where "api" is captured as the
[locale] param and is not covered by generateStaticParams — next-intl falls
back to reading the locale from request headers. That opts the route into
dynamic rendering and Next.js throws "Page changed from static to dynamic at
runtime /api/wallets, reason: headers" (stack shows get requestLocale) instead
of rendering statically.
Call setRequestLocale(locale) first in both the page and generateMetadata,
mirroring the fix in PR #18785 for the videos [slug] page.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 77418ff commit f529f47
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | 44 | | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| |||
386 | 388 | | |
387 | 389 | | |
388 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
389 | 394 | | |
390 | 395 | | |
391 | 396 | | |
| |||
0 commit comments