Skip to content
Latchkey

Clojure "Syntax error compiling at" in CI

The Clojure compiler hit invalid syntax while reading or compiling a form. Unbalanced parens, a malformed special form, or a wrong-arity call stops compilation.

What this error means

Compilation fails with Syntax error compiling at (app.clj:12:3), followed by the specific problem. It is deterministic and points at a location.

lein
Syntax error compiling at (app.clj:12:3).
Call to clojure.core/let did not conform to spec.
  Extra input
  in: [2]

Common causes

Unbalanced or malformed form

A missing or extra paren/bracket, or an odd number of bindings in let, makes the form invalid.

Wrong arity or bad special-form usage

A macro or special form is called with the wrong shape (an extra binding, a missing body), failing its spec.

How to fix it

Balance and correct the form

Fix the bindings and delimiters so the form is well-formed.

app.clj
(let [x 1
      y 2]
  (+ x y))

Read the location and spec message

  1. Open the reported file:line:col.
  2. Use a paren-matching editor or clj-kondo to find the imbalance.
  3. Match the special form to its expected shape.

How to prevent it

  • Use a structural/paren-matching editor.
  • Run clj-kondo to lint forms before compiling.
  • Compile locally before pushing.

Related guides

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