Skip to content
Latchkey

Deno "Unable to load config file" (deno.json) in CI

Deno tried to load deno.json (or the file passed to --config) and failed. The file is missing at the expected path, unreadable, or contains invalid JSON.

What this error means

The run fails with "error: Unable to load config file: ..." naming the path, often followed by a JSON parse detail.

deno
error: Unable to load config file: "/home/runner/work/app/app/deno.json"
    Caused by: Unexpected token '}' at line 8 column 1

Common causes

The config path is wrong or the file is missing

CI runs from a different working directory than expected, or --config points at a path that does not exist on the runner.

Invalid JSON in deno.json

A trailing comma or stray token makes the file unparseable (use deno.jsonc if you need comments).

How to fix it

Point Deno at a valid config

  1. Confirm the step runs where deno.json lives, or pass --config with the correct path.
  2. Validate the JSON so it parses.
  3. Re-run so the config loads.
Terminal
deno run --config=./deno.json main.ts

Use deno.jsonc for comments

If you want comments or trailing commas, name the file deno.jsonc so Deno parses it as JSONC.

deno.jsonc
{
  // build settings
  "tasks": { "start": "deno run -A main.ts" }
}

How to prevent it

  • Keep deno.json valid JSON, or use deno.jsonc for comments.
  • Run CI from the directory that contains the config.
  • Pass --config explicitly when the config is not at the root.

Related guides

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