Repository navigation
Troubleshooting
Louis Wright edited this page Oct 14, 2026
·
3 revisions
📄 Mirrors
docs/troubleshooting.mdin the main repo — the repo version is canonical.
Status: planned / pre-release. This page documents the intended API of next-tongue. Nothing is published yet; names may change before v1.0. See ROADMAP.
| Symptom | Cause | Fix |
|---|---|---|
Route "/[locale]" used headers() inside "use cache" |
Your code (not next-tongue) reads headers in a cached scope | Move the read into a Suspense'd dynamic component; get locale from params |
Type error: Argument of type 'string' is not assignable to parameter of type 'Locale'
|
Raw params.locale passed to getT
|
if (!isLocale(locale)) notFound(); |
TONGUE_E_TYPES_MISSING |
.tongue/types.d.ts missing from tsconfig include or not generated |
Run npx tongue build; check include
|
TONGUE_E_ICU_SYNTAX at build |
Invalid ICU in a message file | Error shows file:key:column; quote literal braces with '{'
|
TONGUE_E_DYNAMIC_KEY |
t(variable) with no declared key set |
t.dynamic(key, { from: [...] }) or t.ns(ns)
|
TONGUE_W_ESCAPE |
t passed as a prop/argument or returned, so the loader cannot see its keys |
Pass strings instead, or accept the whole namespace shipping |
/de/blog/v1.2 not localized |
Default matcher skips paths with a dot | Use the extension-only matcher in Routing & proxy |
/en/about and /about both indexed |
Old setup without canonical redirect |
as-needed redirects /en/* → /* (#30) |
Shell not static under cacheComponents
|
Root [locale] layout lacks generateStaticParams
|
export const generateStaticParams = localeParams |
| Redirect loop |
matcher also matches already-prefixed assets, or a host redirect fights prefix
|
Exclude _next, files, api; align host rules |
404 for / with output: 'export'
|
No proxy in static export |
tongue init --export root page or host redirect |
TONGUE_E_NO_PROVIDER: useT must be used within TongueProvider |
Provider missing in layout | Add TongueProvider to app/[locale]/layout.tsx
|
| Wrong locale after switching | Stale locale cookie | Switcher uses <Link locale>, which updates the cookie via proxy |
| Code | Raised by | Meaning |
|---|---|---|
TONGUE_E_CONFIG |
withTongue, CLI |
Invalid tongue.config.ts (message lists the field) |
TONGUE_E_ICU_SYNTAX |
compiler | ICU parse error |
TONGUE_E_MISMATCH |
compiler, check
|
Args/tags/plural categories differ from default locale |
TONGUE_E_MISSING |
compiler, check
|
Key missing in a locale (when strict.missing: 'error') |
TONGUE_E_DYNAMIC_KEY |
loader | Non-literal key without a declared key set |
TONGUE_W_ESCAPE |
loader |
t escapes the file; whole namespace included |
TONGUE_E_TYPES_MISSING |
types | Generated types not found |
TONGUE_E_UNSUPPORTED_ICU |
compiler | ICU construct outside the supported subset |
TONGUE_E_LOCALE |
server | Invalid locale passed to an action helper |
TONGUE_E_NO_PROVIDER |
client runtime |
useT/useLocale outside TongueProvider
|
TONGUE_W_TIMEZONE |
client runtime (dev) |
useFormat() would format a date in a different zone than the server did; this would cause a hydration mismatch (ADR 0008) |
| Symptom | Upstream |
|---|---|
Localized dynamic segments (/[locale]/x/[id]) not cached with Cache Components |
vercel/next.js#86870, #85240 |
next/root-params types missing with two root layouts |
vercel/next.js#96756 (next-tongue does not depend on it, see ADR 0007) |
Still stuck? Open an issue with the output of npx tongue check --json and your tongue.config.ts.
Guides
- Getting Started
- Configuration
- Routing and Proxy
- Server Components
- Client Components
- Server Actions
- ICU Messages
- Type Safety
- Cache Components and PPR
- Static Export
- Metadata SEO and hreflang
- Database and CMS Messages
- Dev Tools
- Translator Workflow
- Per-user Preferred Language
- CLI
- AI Translation
- Testing
- VS Code Extension
- Migration from next intl
- Migration from next international (deferred)
Reference