---
title: "X18N1004: Invalid YAML plugin"
description: "Invalid YAML plugin. Validate the file against `schema/plugin.json`."
canonical_url: "https://x18n.dev/errors/x18n1004"
---
# X18N1004: Invalid YAML plugin

> Invalid YAML plugin. Validate the file against \`schema/plugin.json\`.

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

## Message

```
[X18N1004] Invalid YAML plugin <detail>
├▶ fix: Validate the file against `schema/plugin.json`.
╰▶ see: https://x18n.dev/errors/x18n1004
```

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

A YAML plugin file does not match the plugin schema. The message names the file, the field and the problem.

1. Add `# yaml-language-server: $schema=https://x18n.dev/schema/plugin.json` as the first line of the file. Your editor then shows the errors.
2. Fix each field that the message lists. See [YAML plugins](https://x18n.dev/plugins/yaml).

## Exit code

The CLI exits with code `2`.

## Source

- [`packages/cli/src/commands/setup.ts`](https://github.com/x18n-dev/x18n/blob/main/packages/cli/src/commands/setup.ts)
- [`packages/node/src/config.ts`](https://github.com/x18n-dev/x18n/blob/main/packages/node/src/config.ts)


## Sitemap

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