Skip to content
Latchkey

Deno "Task not found" in CI

You ran deno task <name> but Deno could not find that task. It is not defined in the tasks section of deno.json/deno.jsonc, or Deno resolved a different config file than the one you edited.

What this error means

deno task build (or similar) fails with "Task not found: build" and lists the tasks Deno does know about. It happens after a rename, or when the config file is not where Deno looks.

deno output
Task not found: build
Available tasks:
- test
- lint

Common causes

Task missing from the config

The task name is not under tasks in deno.json/deno.jsonc - a typo, a rename, or never defined.

Deno reading a different config

Deno walks up for a config file; if CI runs from a subdirectory or a different config is discovered first, your task may not be in the one it loaded.

How to fix it

Define the task and confirm the config

Add the task and list tasks to confirm Deno sees the right config.

deno.json
// deno.json
{
  "tasks": {
    "build": "deno run -A scripts/build.ts"
  }
}
// then verify:
// deno task  (lists available tasks)

Point Deno at the explicit config

In CI, pass the config path so there is no ambiguity about which file Deno loads.

Terminal
deno task --config ./deno.json build

How to prevent it

  • Keep tasks defined in a single committed deno.json/deno.jsonc.
  • Run deno task (no name) in CI to confirm available tasks.
  • Pass --config when CI runs from a non-root directory.

Related guides

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