Skip to content

Bug: <Suspense> with a lazy() Component loads forever #33020

Open
@Jens-n11

Description

@Jens-n11

Version

"react": "19.1.0",
"react-dom": "19.1.0"

OS: Ubuntu 24.04 and MacOS 15.3.2

Overview

Our React-App uses Icons which are lazy() loaded and surrounded by a <Suspense>. We are now seeing issues for components using one of the Icons when also a state is updated within a useEffect().
While updating from React 18.3.1 to React 19.1.0 a few of our tests are running forever (infinite loop?).
We were able to narrow it down to the React upgrade and created a minimal test case for this.

Related Issues

#29930: [React 19] infinite loop when using React lazy & functional formAction together

Steps To Reproduce

  1. Open CodeSandbox (Or use the GitHub backup: https://github.com/Jens-n11/react-bug-suspense)
  2. Download the code
  3. Run yarn install
  4. Run yarn test:only-hanging
  5. Will load forever

Image

Cases where the bug does not happen:

  • Using React 18.3.1 instead of 19
  • When rendering less than 3 Icons
  • When running all tests (so having a working test-case right before) yarn test:all
  • Doing no state update from the useEffect

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: UnconfirmedA potential issue that we haven't yet confirmed as a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions