---
title: "X18N0001: Invalid config"
description: "Invalid config. Check the reported field against the config schema (`x18n schema config`)."
canonical_url: "https://x18n.dev/errors/x18n0001"
---
# X18N0001: Invalid config

> Invalid config. Check the reported field against the config schema (\`x18n schema config\`).

<!-- Generated by docs/scripts/generate.ts from the source code. Do not edit. -->

## Message

```
[X18N0001] Invalid config <detail>
├▶ fix: Check the reported field against the config schema (`x18n schema config`).
╰▶ see: https://x18n.dev/errors/x18n0001
```

The CLI prints the code and why the error happened, with details such as a file name or a field. The fix and a link to this page follow. With `--json`, the same parts are in `errors` of the [envelope](https://x18n.dev/references/json-contracts).

## What to do

The config, or the input of a command, does not match what x18n expects. The message names the field and the problem, for example `usage.include: Invalid type`.

1. Read the field path in the message and compare the value with the [config reference](https://x18n.dev/references/config).
2. YAML and JSON configs reject unknown keys. If the field is a typo, fix the name.
3. Add `$schema: https://x18n.dev/schema/config.json` to a YAML or JSON config. Your editor then shows the errors as you type.

The CLI uses the same code for command input it cannot use: an unknown `--reporter` id, an unknown `x18n prompt` kind, a missing `--to`, or an `x18n.config.*` that already exists when you run `x18n init` or `x18n migrate` without `--force`.

## Exit code

The CLI exits with code `2`.

## Source

- [`packages/cli/src/commands/check.ts`](https://github.com/x18n-dev/x18n/blob/main/packages/cli/src/commands/check.ts)
- [`packages/cli/src/commands/migrate.ts`](https://github.com/x18n-dev/x18n/blob/main/packages/cli/src/commands/migrate.ts)
- [`packages/cli/src/commands/prompt.ts`](https://github.com/x18n-dev/x18n/blob/main/packages/cli/src/commands/prompt.ts)
- [`packages/cli/src/commands/setup.ts`](https://github.com/x18n-dev/x18n/blob/main/packages/cli/src/commands/setup.ts)
- [`packages/cli/src/commands/translate.ts`](https://github.com/x18n-dev/x18n/blob/main/packages/cli/src/commands/translate.ts)
- [`packages/core/src/resolve.ts`](https://github.com/x18n-dev/x18n/blob/main/packages/core/src/resolve.ts)


## Sitemap

See the full [sitemap](https://x18n.dev/sitemap.md) for all pages.
