React hook error after upgrade to a12-2025.06-ext4 (Rendered fewer hooks than expected)

Hi all,
after upgrading to the latest a12-2025.06-ext4, we started seeing this runtime error in the UI:
Error: Rendered fewer hooks than expected. This may be caused by an accidental early return statement.
It happens during tree/table rendering (not on initial app boot), and appears reproducibly when opening/editing tree-based views.
From stack traces, possible A12-related sources seem to be:

  • @com.mgmtp.a12.widgets/widgets-core
    (especially table/tree-table templates like head row/segment rendering)
  • @com.mgmtp.a12.treeengine/treeengine-core
    (TreeEngine renderer path)
  • @com.mgmtp.a12.client/client-core
    (layout/container wrappers around the engine)

We already checked our own wrappers for obvious conditional hooks/early returns, but the error still points into the A12 widget/render path.

Has anyone seen this after moving to a12-2025-ext4?
Any ideas for mitigation/debug strategy (known patch, version combo, or specific files to check first)?

Thanks a lot.

hi @gerrit-flat-sand,

this sounds like an known error that is contained in a specific version of styled components.

This workaround should fix thisfor the moment:

Set version of styled-components to 6.1.19. (6.4.0 causes the errors)

Hi @gerrit-flat-sand ,

We already have an A12 ticket to address this issue: A12-18689
At the moment, please try to downgrade styled-components from 6.4.0 to 6.1.19.

The downgrade of styled-components seems to work, thank you for your help!

Hi everyone, Widgets 38.3.4 is released and fixed the incompatibility with latest styled-components, so you can upgrade again :slight_smile: