# Atlas error: Config file at <path> is not valid JSON(C)

> Open the path named in the message and fix the syntax at the reported line and column, where the caret points under the offending character.

Atlas exits with Config file at <path> is not valid JSON(C) because config/parse.ts collected one or more JSONC parse errors and threw ConfigJsonError. The fix is to open the path named in the message and correct the syntax at the reported line and column, where a caret points directly under the offending character. Common causes are a trailing comma, an unquoted key, or a smart quote pasted from a doc. Atlas accepts JSONC, so `//` comments are fine, but an unclosed `/* */` block is not.

## Symptom

Atlas exits with: Config file at <path> is not valid JSON(C), followed by a JSONC error dump showing the line, the column, and a caret under the offending character.

## Cause

config/parse.ts collects JSONC parse errors and throws ConfigJsonError with a rendered block containing the input, the error list, and a caret pointing at the column. The CLI formatter prints the headline sentence, so the exit happens before any schema validation runs.

## Fix

1. Open the path named in the message and fix the syntax at the reported line and column.
2. Check the usual causes: a trailing comma, an unquoted key, or a smart quote pasted from a doc.
3. Keep `//` comments if you want them, because Atlas accepts JSONC, but close any `/* */` block you opened.
4. Re-run Atlas, because parse.ts throws before any schema validation, so the JSON has to be fixed first.
5. Confirm the run starts with no ConfigJsonError and no caret dump.

## Why does Atlas say my config file is not valid JSON(C)?

Atlas says Config file at <path> is not valid JSON(C) because config/parse.ts collected JSONC parse errors and threw ConfigJsonError. The rendered block contains 3 things, the input, the error list, and a caret pointing at the column, so the exact offending character is already identified for you.

The error is purely syntactic. config/parse.ts in Atlas parses the config as JSONC, gathers every parse error it finds, and throws ConfigJsonError carrying a rendered block: the input, the list of errors, and a caret under the column that broke. The CLI formatter then prints the headline sentence, Config file at <path> is not valid JSON(C), above that block. Nothing about the meaning of your keys is being judged at this point. Atlas has not reached schema validation yet, which is why a key name you are unsure about is not the thing to investigate first.

## How to read the JSONC caret dump in Atlas

The Atlas JSONC error dump shows 3 things: the input, the error list, and a caret pointing at the column. Read the caret first, because config/parse.ts places it directly under the offending character at the reported line and column, which is where the syntax fix belongs.

The caret is the fastest path to the fix. config/parse.ts renders your input alongside the error list and drops a caret under the exact column the JSONC parser choked on. Jump to that line and column in the file named by Config file at <path> is not valid JSON(C) and look one character to the left and right of the caret. A caret sitting under a closing brace usually means a trailing comma on the line above. A caret under a quote often means a smart quote pasted from a doc rather than a plain ASCII quote.

## What actually breaks JSONC in an Atlas config?

Atlas ConfigJsonError failures come from 3 causes: a trailing comma, an unquoted key, or a smart quote pasted from a doc. Atlas accepts JSONC, so `//` comments are fine, but a stray `/* */` block that is never closed will fail the parse just as hard.

A trailing comma is the classic one, because many editors and many other formats tolerate it. JSON and JSONC do not. An unquoted key is the second, and it usually comes from writing the config the way JavaScript object literals are written. The third is the sneaky one: a smart quote pasted from a doc looks almost identical to a plain quote in most terminals but is a different character entirely, and the caret in the Atlas dump is often the only thing that reveals it. Comments themselves are not the problem, since Atlas parses JSONC and `//` comments are valid.

## Do comments break the Atlas config file?

Comments do not break an Atlas config file. Atlas accepts JSONC, so `//` line comments are fine. A stray `/* */` block that is never closed is the 1 comment form that fails, because the unterminated block runs past the rest of the file and config/parse.ts throws ConfigJsonError.

The JSONC support in Atlas is real, so there is no need to strip comments out of a config to make it parse. Line comments introduced with `//` are valid and survive parsing. The trap is the block comment. An opening `/*` with no matching `*/` swallows every line that follows it, and the parse error that results often points at a location far from the actual mistake, because the parser only notices something is wrong once it hits the end of the file. When the caret lands somewhere that looks fine, scan upward for an unclosed `/* */`.

## Why does Atlas fail on JSON before checking my config keys?

Atlas fails on JSON before checking config keys because config/parse.ts throws before any schema validation runs. Parsing is phase 1: Atlas must produce a parsed document before it can evaluate what is in it, so ConfigJsonError always wins over any schema issue present in the same file.

The ordering has a practical consequence: fix the JSON first. If you are staring at a config that has both a trailing comma and a misspelled key, Atlas will report only Config file at <path> is not valid JSON(C), and it will keep reporting only that until the syntax parses. The misspelled key is still there, and it will surface as a schema issue on the next run once parsing succeeds. Do not read the absence of key errors as proof the keys are correct. Atlas computes a unified diff for every file edit and surfaces it for approval before writing, so if you let Atlas edit the config for you, you can see the syntax fix before it lands.

## How to verify the config parses again in Atlas

Verify the Atlas config fix by re-running Atlas after correcting the line and column named in the dump. 2 outcomes are good news: a clean start, or a schema issue instead of a parse error, since both mean config/parse.ts parsed the JSONC and moved on to validation.

Re-running Atlas is the verification, since config/parse.ts runs on every start. Two outcomes are good news. The first is a clean start, which means the syntax is fixed and the schema is happy too. The second is a schema issue rather than a parse error, which also means the JSONC now parses, and the remaining work is at the key level rather than the syntax level. Only a repeated ConfigJsonError means the syntax is still broken, and in that case the caret has moved to the next offending character, so read the new line and column rather than the old one.

## FAQ

### How do I fix Config file is not valid JSON(C) in Atlas?

Open the path named in the message and fix the syntax at the reported line and column. The Atlas JSONC error dump prints a caret under the offending character, so the exact position is given. Re-run Atlas once the syntax is corrected.

### Can I use comments in an Atlas config file?

Yes. Atlas accepts JSONC, so `//` comments are fine. A stray `/* */` block that is never closed is not fine and will cause config/parse.ts to throw ConfigJsonError, so make sure every block comment you open is closed.

### What causes a JSONC parse error in Atlas config?

The common causes are a trailing comma, an unquoted key, or a smart quote pasted from a doc. config/parse.ts collects the parse errors and throws ConfigJsonError with a caret pointing at the column that failed.

### Why does Atlas not report my config key errors too?

parse.ts throws before any schema validation, so a JSONC syntax error stops Atlas before it ever looks at your keys. Fix the JSON first, re-run Atlas, and any remaining schema issues will be reported on that next run.

### What is ConfigJsonError in Atlas?

ConfigJsonError is the error config/parse.ts throws when it collects JSONC parse errors. It carries a rendered block containing the input, the error list, and a caret pointing at the column, and the CLI formatter prints the headline sentence above it.

### Why does my Atlas config fail after I pasted it from documentation?

A smart quote pasted from a doc is one of the documented causes. Smart quotes look like plain quotes but are different characters, and the JSONC parser rejects them. Replace them with plain quotes at the line and column the Atlas caret points to.

---

Canonical HTML: https://runatlas.sh/resources/troubleshooting/config-not-valid-jsonc
Source of truth: aeo_pages row `/resources/troubleshooting/config-not-valid-jsonc` (segment: Troubleshooting) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
