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.
Cannot find configuration for task api:buildCommon 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
- Open the project's
project.jsonand confirm the target exists undertargets. - Add the missing target with an executor, or fix the target name you invoke.
- Re-run
nx build apito confirm the task resolves.
{
"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.
nx show project api --jsonHow to prevent it
- Keep
targetDefaultsinnx.jsonso 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.