Nexus

TEAL compile error: "pop expects 1 stack arguments but stack height is 0"

Short answer: An opcode needs values on the stack and the compiler can show the stack is empty at that point.

The exact message

1 error: 2: pop expects 1 stack arguments but stack height is 0

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

Why it happens

Captured with pop as the first instruction. The error is reported at compile time, not at run time, when the stack depth is statically known.

How to fix it

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