Skip to content

The browser crashes when use React.lazy return Promise.resolve(undefined) #15019

Open
@angular-moon

Description

@angular-moon

Do you want to request a feature or report a bug?
bug

What is the current behavior?
The browser crashes

const Loading = () => <div>loading...</div>;
const Component = lazy(() => Promise.resolve(undefined));

function App() {
  return (
    <div className="App">
      <Suspense fallback={<Loading />}>
        <Component />
      </Suspense>
    </div>
  );
}

I can't provide an example of CodeSandbox, which would cause the browser to crash

What is the expected behavior?
throw Error

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
[email protected]
[email protected]
chrome 72.0.3626.119

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions