Skip to content

Bug: React fails to log invariant 306 message when lazy() resolves to a Fragment #26910

@tom-sherman

Description

@tom-sherman

React version: 18.2.0

Steps To Reproduce

  1. Try to render this component: const LazyFragment = lazy(() => Promise.resolve({ default: Fragment }));

Link to code example:

https://github.com/tom-sherman/react-lazy-fragment-bug

The current behavior

It throws an error:

Cannot convert a Symbol value to a string

The expected behavior

It should throw an error related to invariant 306 eg.

Element type is invalid. Received a promise that resolves to: Fragment. Lazy element type must resolve to a class or function.

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