Skip to content

Invalid hook call warnings during server-island SSR (duplicate React in the tree) #754

Description

@jamiefolsom

Rendering /en/pages/<slug> in dev logs four React warnings while the server islands render:

10:49:36 [200] /_server-islands/Page 279ms
Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. …
3. You might have more than one copy of React in the same app
10:49:36 [200] /_server-islands/Header 561ms
(same warning ×3 more, on Header and Footer)

The pages return 200, but hook failures during SSR can mean a component silently renders degraded, so this deserves a look rather than a mute.

The "more than one copy of React" suggestion is literally true in our tree:

  • react@19.2.4 is installed (not deduped) via @clerk/clerk-js@solana/wallet-adapter-react (Clerk's web3 login support).
  • @cu-mkp/editioncrafter's Material-UI 4 packages resolve to the root react@18.3.1 but npm marks them invalid (they declare 16/17 peers).

Suggested first steps: reproduce with a stack trace to identify which island component triggers it, then decide between an overrides pin and dedupe. Found while surveying fds dev logs (marronage, 48a160a) — see #753 for the rest of that survey.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions