Skip to content

dependent_key_missing

A key that is present requires sibling keys that are absent.

A key declared as (key :name offset … :requires [buffer]) may only appear alongside the keys it names. Writing :offset without :buffer fires this; writing neither is fine, because the rule only applies once the dependent key is present.

The message lists every absent requirement at once, so a key with three unmet dependencies produces one diagnostic naming three, not three separate complaints.

Two repairs. Supply the keys it names, usually right, since the dependent key is typically meaningless without them (a :offset into no buffer describes nothing). Or drop the dependent key, if it was written by mistake.

Which of the three mechanisms is this? A form has three ways to relate keys, and picking the wrong one is the common mistake:

  • :requires: presence implies presence. “If :offset is here, :buffer must be too.” One-directional; the reverse is fine.
  • (exclusive-group …): bounds how many of a set may appear. “At most one of :color / :gradient.” Symmetric.
  • (variant …): gates keys on another key’s value, not its presence. “:strip-index-format applies only when :topology is triangle-strip.”

If your rule mentions a specific value, you want a variant. If it counts, you want a group. If it says “then also”, you want this.


Run sjon explain dependent_key_missing to read this at a terminal, browse every code, or work through diagnostics-driven repair if you want the habit rather than the answer.