You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Backend var Fields are accepted by several APIs and fail later at render/compile time #7459
Class access to a field with no frontend Var returns the raw Field descriptor. That covers State._secret, a field declared with rx.field(..., is_var=False), and any field of a mixin state. Users pass it by mistake wherever a state var fits. After #7456, every error message on these paths reports the field's repr. But the APIs below accept the Field without complaint at the call site, so the failure only shows up later, when the page renders or compiles, with a generic error and a traceback nowhere near the user's line.
With F = State._secret:
Call
What happens
rx.toast(F), rx.console_log(F)
TypeError: Unsupported type ... for LiteralVar when the event chain is rendered
returns a FileUpload holding the Field; it fails only when bound to a handler
app.add_page(..., title=F) (presumably description and image too)
stored as-is; compiling it raises ChildrenTypeError from Title.create
Proposal: reject a Field where it is passed in (event actions, untyped/Any props, nested values in LiteralVar.create, page metadata) with a clear message, ideally BackendVarFormatError's wording so users get the same explanation.
Also worth a test: rx.get_upload_url(F) (reflex_components_core/core/upload.py) and the reflex/experimental/hooks.py helpers now raise BackendVarFormatError where they used to silently put Field(...) into a URL or into JS. That's the intended behaviour, but no test covers it.
changed the title [-]Backend var Fields are accepted by many APIs and fail later, or get a generic error[/-][+]Backend var Fields are accepted by several APIs and fail later at render/compile time[/+]on Oct 6, 2026
Two more cases from the 0.10.0a3 pre-release re-check (finding N-006). #7475 fixed the BackendVarFormatError wording, but these paths still never reach it:
Silent string embedding:str(S._size) + "px", "%s" % S._size and f"{S._size!s}" silently embed Field(default=16, ...) in the rendered value. The 0.10 upgrade guide now documents this, but nothing raises.
Cryptic error:rx.box(id=S._label) fails with TypeError: expected string or bytes-like object, got 'Field' instead of BackendVarFormatError.
Activity
linear-code commentedon Oct 6, 2026
ENG-13102
[-]Backend var Fields are accepted by many APIs and fail later, or get a generic error[/-][+]Backend var Fields are accepted by several APIs and fail later at render/compile time[/+]masenf commentedon Oct 8, 2026
Two more cases from the 0.10.0a3 pre-release re-check (finding N-006). #7475 fixed the
BackendVarFormatErrorwording, but these paths still never reach it:str(S._size) + "px","%s" % S._sizeandf"{S._size!s}"silently embedField(default=16, ...)in the rendered value. The 0.10 upgrade guide now documents this, but nothing raises.rx.box(id=S._label)fails withTypeError: expected string or bytes-like object, got 'Field'instead ofBackendVarFormatError.Script:
prerelease_testing/2026-10-07/reverify_core/scripts/derive_e_format.py.``Generated by Claude Code