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 1Common 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
- Confirm the step runs where deno.json lives, or pass
--configwith the correct path. - Validate the JSON so it parses.
- Re-run so the config loads.
Terminal
deno run --config=./deno.json main.tsUse 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
--configexplicitly when the config is not at the root.
Related guides
Deno "Relative import path not prefixed with / or ./ or ../" in CIFix Deno "error: Relative import path ... not prefixed with / or ./ or ../" in CI - a bare specifier was used…
Deno "deno: command not found" in CI (setup-deno)Fix "deno: command not found" in CI - the runner has no Deno on PATH because the setup-deno step is missing o…
Deno check "TS2307 Cannot find module or its type declarations" in CIFix Deno "error: TS2307 Cannot find module ... or its corresponding type declarations" in CI - deno check cou…