Repository navigation
Description
Bug
Opening a report detail page in dev crashed with a next-intl MISSING_MESSAGE error:
MISSING_MESSAGE: Could not resolve `reports.templates.executive_summary.name` in messages for locale `en`.
at ReportDetailPage (src/app/[locale]/(dashboard)/dashboard/reports/[id]/page.tsx:175:18)
Code frame (from #419):
{KNOWN_TEMPLATE_IDS.has(report.template) && (
<>{t(`templates.${report.template}.name`)} · </>
)}Next.js 16.1.6 (Turbopack), locale en.
What we verified
web/messages/en.jsoncontainsreports.templates.executive_summary.name(all four template ids are present under the correct namespace).- The file parses with no duplicate keys, so nothing shadows the
reportsnamespace. NextIntlClientProviderinweb/src/app/[locale]/layout.tsxreceives the full message tree — there is no namespace filtering that could dropreports.templates.
So the key exists in the source, yet the running dev server could not resolve it. The most plausible cause is a stale Turbopack module cache for the dynamically imported messages/en.json (e.g. after switching branches while the dev server keeps running), which serves the old message tree against the new page code.
Proposed fix
Regardless of the cache root cause, a missing i18n key should degrade gracefully instead of taking down the whole report page:
-
Guard the lookup with
t.has(...)(available in next-intl v4) in both the report detail header and anywhere else template names are rendered (reports list, generate dialog), falling back to hiding the template label:{KNOWN_TEMPLATE_IDS.has(report.template) && t.has(`templates.${report.template}.name`) && ( <>{t(`templates.${report.template}.name`)} · </> )}
-
Confirm whether the error reproduces on a clean dev-server start of the branch. If it does, this is a real message-loading bug and needs deeper investigation; if not, document it as a Turbopack HMR staleness artifact.
How to reproduce (suspected)
- Run the dev server on a branch without the report-template i18n keys.
- Switch to feat(reports): templates with section picker, four new modules, deltas and change-story summary #419 without restarting the dev server.
- Open any generated report's detail page.
Acceptance criteria
- Report detail page renders even when a template-name message key cannot be resolved (label is simply omitted).
- Verified whether the error still occurs after a clean dev-server restart on the branch, and the finding is noted on this issue.
Activity
Maqbool61 commentedon Jul 14, 2026
Hi, I'd like to take this on!
My plan: add a t.has(\templates.${report.template}.name
)guard at the three render sites (report detail header, reports list, generate dialog) so a missing key silently omits the template label instead of crashing the page. I'll also do a clean dev-server restart on the branch and note the finding here as the acceptance criteria requires.Could you assign this to me? Thanks!