Skip to content

v0.8.22: React lazy loading error using rx.recharts after React Router upgrade #6029

@tartansandal

Description

@tartansandal

After upgrading from reflex 0.8.21 to 0.8.22, pages with nested state classes fail to render with React lazy loading errors.

Root cause investigation:
PR #6022 upgraded React Router from 7.9.6 to 7.10.1. This appears to trigger issues with how Reflex generates lazy-loaded components.

Error message:
[Reflex Frontend Exception]
Error: Element type is invalid. Received a promise that resolves to: undefined.
Lazy element type must resolve to a class or function.
at beginWork (react-dom_client.js:6140:13)

Reproduction pattern:
The issue occurs on pages that have:

  • Multiple state classes with mixins (e.g., class MyState(SomeMixin, GlobalState))
  • Nested component imports across modules
  • State classes that inherit from a common parent state

Minimal context:
Our affected page uses:

  • Vertical tabs with rx.tabs.root
  • Multiple state classes extending a GlobalState with mixins
  • Dialog components imported from submodules
  • rx.cond() for conditional rendering

Workaround:
Pin reflex to 0.8.21: reflex==0.8.21

Related issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions