Skip to content

Every error Flux surfaces — in the dev server log, the on-device red banner, or the CLI output — belongs to the unified error taxonomy: three classes, each carrying a what / where / why / how payload. This guide is keyed to that taxonomy so you can go from message to fix.

Class When it fires Where you see it
Compile Parse, type-check, or lowering failure Dev server log, flux lsp, VS Code
Runtime VM fault during handler evaluation On-device overlay, server log, trace
Capability A CALL_CAP denied by the host or OS On-device red banner, trace

Typical shape:

[compile:Parse] expected `Int`, got `String` (hint: `count` was inferred as Int at line 18)
[compile:Type] …
[compile:Lower] …

Each compile error carries a phase, a message, a span (file:line:col), and an optional hint.

Phase What it means Common cause Fix
Parse The parser rejected the source Mixed indentation and braces, or a missing indent under a view call Follow the indentation grammar; run flux dev and read the caret
Type The type checker rejected an expression A signal used as the wrong type, or a handler body that mismatches its prop type Read the hint — it names the previously inferred type and location
Lower The typed AST could not lower to the IR A construct outside the supported surface Simplify the expression; check flux doc for the supported surface

Fix path: open the file:line:col from the span, read the hint, and re-express the construct. Compile errors are deterministic — re-running flux dev reproduces them exactly.

Typical shape:

[runtime] gas budget exhausted at offset 42
[runtime] division by zero at offset 17

Runtime errors wrap a stable VM fault kind, so the fault code is load-bearing and asserted by the golden ISA vectors. The offset points at the offending instruction, which tells you which Flux expression lowered to it.

A handler ran for more than 100,000 instructions. Break the work into smaller handlers, or remove an accidental infinite loop or unbounded recursion.

The 16 MiB frame memory pool ran out — usually large literals or deep frames. Reduce the data held in handler scope; page large data through a capability instead of inlining it.

A list, record, or string index fell outside its bounds. Guard the index before access — this is a logic bug in the handler.

A field access was performed on Null. Check the value before field access, or ensure the upstream signal is initialized; the ?? operator covers the common fallback case.

The dispatch byte was not a valid opcode — usually a corrupt or stale patch frame. Restart flux dev. If it recurs, treat it as a wire or lowering bug and file an issue with the frame bytes.

Operands did not match what the monomorphized opcode expects — ADD_I64 needs two integers, ADD_F64 two floats. Align the operand types.

Integer division or remainder by zero fails as an error, never a panic. Guard the divisor before the / or % operation.

Fix path: the fault is deterministic and reproducible. The handler bytecode around the reported offset maps back to a specific Flux expression — fix that expression.

Typical shape:

[capability] `Storage.removeItem` (2/3): the OS grant `.storage` was not authorized for this capability call

Capability errors carry the numeric cap_id / method_id, the resolved cap_name / method_name when registered, the required OS permission, and a human-readable why. They never crash the app — the denied call does not run, and the host renders a red banner.

  • Root cause: a capability call reached a service gated behind an OS permission the user has not granted (Camera, Location, Notifications).
  • Fix: request and await the permission before calling the capability. The host surfaces the system prompt; re-invoke the handler after the grant resolves.

Capability ids are derived deterministically — see the capabilities reference for the id table.