# A file has a mistake

What "a file has a mistake" means and how to fix it.

```text
error: packages/bad/package.json has a mistake at line 5, column 1: the file ends too early, so a closing } or ] is probably missing
hint: Fix the mistake at that spot, then run axle again.
```

## Why it happens

A `package.json`, `pnpm-workspace.yaml` or `axle.toml` isn't valid JSON, YAML or TOML, or a field has the wrong type, such as a `name` that is a number. [`axle setup agents`](https://axlers.dev/docs/reference/mcp.md#setting-up-agents) reports the same for an agent's file, such as a `.vscode/mcp.json` whose `servers` isn't an object, or an `AGENTS.md` that has only one of the two lines around Axle's guidance. In `axle.toml`, a key Axle doesn't know is a mistake too, and the message lists the keys allowed there:

```text
error: axle.toml has a mistake at line 2, column 1: unknown field `output`, expected one of `outputs`, `env`, `passThroughEnv`, `cache`
hint: Fix that line of axle.toml, then run axle again.
```

Some values are mistakes even though they have the right type:

- an input entry naming a set that doesn't exist, such as `^prod`, or input sets that include each other in a circle
- an entry starting with `^` anywhere but a task's `inputs`, or after a `!`
- a `description` in a [variant](https://axlers.dev/docs/reference/configuration.md#variants), which keeps its task's
- a [project](https://axlers.dev/docs/reference/configuration.md#projects) without a `name`, a task of a project without a `command`, or a `name` in a package's own `axle.toml`, where the name comes from `package.json`

```text
error: services/worker/axle.toml has a mistake: a project listed under projects in axle.toml needs a name
hint: Fix that line of services/worker/axle.toml, then run axle again.
```

The message names the file, the line and column when there is one, and what is wrong there.

## How to fix it

Open the file at that line and column and fix it. Common causes are a missing `}` or `]`, a comma after the last item, a missing quote, and a misspelt key. The [configuration reference](https://axlers.dev/docs/reference/configuration.md) lists every key of `axle.toml`.
