Nexus

TEAL compile error: "int expects 1 immediate argument"

Short answer: The opcode needs a value written after it on the same line, and it was missing.

The exact message

2:3: int expects 1 immediate argument
3: return 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 a bare int line. The compiler reported two lines: the missing immediate (2:3, line:column) and a follow-on return expects 1 stack arguments but stack height is 0, which is a consequence, not a second mistake.

How to fix it

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