# A task failed

What "a task failed" means and how to fix it.

```text
error: @acme/ui#build failed with exit code 2
hint: Run axle run @acme/ui#build --only to see it by itself.
```

## Why it happens

The script ended with an error. Its own output, above the message, says why. Unless you pass `--continue`, Axle stops the other tasks.

In strict environment mode, the default, a script only sees the environment variables Axle passes on and those `axle.toml` lists. If it failed and some variables were left out, the hint says how many:

```text
hint: Run axle run @acme/ui#build --only to see it by itself. It ran without 12 environment variables that strict mode leaves out; if it needs one, list it under env in axle.toml.
```

## How to fix it

Fix what the script reports. If it needs a variable strict mode left out, list it under the task's `env` or `passThroughEnv`, or `globalEnv` or `globalPassThroughEnv` for every task, in [axle.toml](https://axlers.dev/docs/reference/configuration.md#environment-variables), or try `--env-mode loose` to check. Axle's own exit code is the first failing script's.
