Options and Limits
Options
Options go under i18nKit in nuxt.config.ts. That block configures this
module and nothing else — no kit policy is read from it. Policy lives in
i18n-kit.config.ts or .i18n-mcp.json; see Where Configuration
Lives.
| Option | Type | Default | Effect |
|---|---|---|---|
enabled | boolean | true | With false, the module does nothing: no artifact, no validation. The CLI falls back to adapter detection, exactly as without the module installed. |
failOnInvalidConfig | boolean | true | With false, configuration problems are printed at their own level and the build continues. See What It Validates. |
export default defineNuxtConfig({
modules: ['@nuxtjs/i18n', '@the-i18n-kit/nuxt'],
i18nKit: {
enabled: true,
failOnInvalidConfig: true,
},
})
There is no third option, and in particular no option for the artifact's path or
filename: the CLI looks for <app>/.nuxt/i18n-kit.json without loading your
Nuxt config, so a renamed or relocated artifact is simply not found.
Limits
The artifact is a build product. A checkout that has never built does not have one, and neither does a CI job that runs the kit before the build. That is the central limit, and it is why kit policy is deliberately not published here: anything reaching the CLI only through a build applies only after a build.
Everything the CLI can find wrong with an artifact is treated as a reason to fall back to loading the app through Nuxt — never as an error.
| Situation | What the CLI does |
|---|---|
No .nuxt/i18n-kit.json | Loads the app, with no message. This is the state of every project that has not built. |
| The file is not valid JSON | Warns Ignoring <path>, with the parse error, and loads the app |
The file does not match the shape this CLI understands — including a version other than 1, an empty locale table, or no layers | Warns Ignoring <path>: not a shape this CLI understands, naming the field and the reason, and loads the app |
A nuxt.config of the app or of any layer the artifact describes is newer than the artifact | Warns that it has changed since generation, suggests nuxt prepare, and loads the app |
| The artifact describes layers but none with a locale directory | Warns describes no locale directories, and loads the app |
A custom buildDir, or the file renamed | The CLI does not find it, so it loads the app as it would without the module |
Falling back is not free: loading the app requires @nuxt/kit in the project
and a nuxt.config.ts that evaluates in the environment the CLI is running in.
When that fails, the Nuxt adapter reports it.
Staleness is judged by modification time against each nuxt.config the artifact
names — the app's and every layer's. An unreadable timestamp is not treated as
evidence of staleness, and a config the CLI cannot find is skipped. Editing a
file that a nuxt.config reads, without touching the config itself, does not
make the artifact look stale.
Two more limits, on the producer side:
- The module publishes nothing without
@nuxtjs/i18n. With noi18nblock on the resolved Nuxt options, or with a block that resolves zero usable locales, it warns and writes no file. An empty locale table would leave the CLI unable to tell "no locales" from "not built". - JSON locale files only.
localeFileFormatis published asjsonand the CLI accepts nothing else in the artifact.
nuxt prepare (or your normal build)
before any kit command. Without it, commands still work — they load the app —
so a pipeline that forgets loses speed, not correctness.