Skip to content
Latchkey

taplo TOML "expected" syntax error in CI

taplo lint parses TOML and reports "expected ..." when it reaches a token that does not fit the grammar, for example a value that is not quoted, a missing bracket, or an equals sign out of place.

What this error means

taplo lint (or taplo check) exits non-zero with an "expected ..." message and a line:col span pointing at the invalid TOML.

taplo
error: expected value
  ┌─ pyproject.toml:5:10
  │
5 │ name = my package
  │          ^^^^^^^^^^ expected value

Common causes

An unquoted string value

TOML strings must be quoted; name = my package is invalid because a bare multi-word value is not a value.

A malformed table header or missing bracket

A [section without its closing bracket, or a stray token, makes the parser expect something it does not find.

How to fix it

Quote strings and close brackets

  1. Go to the line:col taplo printed.
  2. Quote string values and balance any [ ] table headers.
  3. Re-run taplo lint to confirm.
pyproject.toml
# wrong
name = my package
# right
name = "my package"

Format with taplo to normalize syntax

Once it parses, taplo fmt normalizes spacing and quoting so style stays consistent.

Terminal
taplo fmt pyproject.toml

How to prevent it

  • Run taplo lint in a pre-commit hook for .toml files.
  • Always quote TOML string values.
  • Format with taplo fmt to keep syntax consistent.

Frequently asked questions

What causes ""expected ..." (TOML)"?
TOML strings must be quoted; name = my package is invalid because a bare multi-word value is not a value.
How do I fix "expected ..." (TOML)?
Quote strings and close brackets

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card