Skip to content
Latchkey

Nx "Cannot find configuration for task" in CI

Nx tried to run a target such as build or test on a project and found no matching target in that project's project.json, an inferred plugin config, or targetDefaults. The task cannot be scheduled, so the run stops.

What this error means

Nx aborts with "Cannot find configuration for task project:target" when you invoke nx run, nx build, or nx affected. It reproduces every run because the config is missing, not flaky.

Nx
Cannot find configuration for task api:build

Common causes

The target is not defined on the project

The project's project.json (or an inferred config from a plugin) has no build target, so Nx has nothing to run for api:build.

A typo in the project or target name

The name passed on the command line does not match a real project:target pair, so the lookup fails.

How to fix it

Declare the target on the project

  1. Open the project's project.json and confirm the target exists under targets.
  2. Add the missing target with an executor, or fix the target name you invoke.
  3. Re-run nx build api to confirm the task resolves.
apps/api/project.json
{
  "name": "api",
  "targets": {
    "build": {
      "executor": "@nx/webpack:webpack",
      "options": { "outputPath": "dist/apps/api" }
    }
  }
}

List real targets before running

Print the resolved project configuration so you invoke a target that actually exists.

Terminal
nx show project api --json

How to prevent it

  • Keep targetDefaults in nx.json so common targets are defined once.
  • Use nx show project <name> to confirm targets before scripting them in CI.
  • Fix target names in workflows when you rename or remove a target.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →