Skip to content

With from __future__ import annotations, an undefined name in a var annotation fails with TypeError: Unsupported type ForwardRef('list[Item]') for guess_type instead of a NameError naming the symbol #7488

Closed

Description

@masenf

Severity: LOW, regression vs 0.9.12 (which raised NameError: name 'Item' is not defined); present on 0.10.0a1 and 0.10.0a2.

from __future__ import annotations
import reflex as rx

class S(rx.State):
    items: list[Item] = []   # Item not defined / defined later

0.10 raises TypeError: Unsupported type ForwardRef('list[Item]') for guess_type. deep inside var typing, so the user does not learn which name is missing. Related history: #2848, #3437. Resolve the annotation with the module globals and surface the NameError (or name the unresolved symbol in the TypeError).

Evidence: thirdparty_a2/logs/f011-fwdref.txt; finding F-011 (10-06) and its 10-07 row in FINDINGS.md.

Activity

  1. added theissue type on Oct 7, 2026
  2. linear-code commented on Oct 7, 2026

    @linear-code
  3. added
    release-train
    on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    release-train

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions