Nexus

TEAL compile error: "reference to undefined label"

Short answer: A branch (b, bz, bnz, callsub) points to a label that is not defined anywhere in the program.

The exact message

1 error: 2:2: reference to undefined label "nowhere"

Source: POST /v2/teal/compile, HTTP 400, captured against a public TestNet node on 2026-12-03.

Why it happens

Captured with b nowhere and no nowhere: line. The message names the label and gives line and column (2:2).

How to fix it

Wording can change between node versions. All API errors · errors.json · transaction errors · SDK errors · costs