Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

320
Views
React Lazy and Suspense issue

i have create e simple test app with CRA for testing Lazy / Suspense features in react 18, but I'am stuck, this is my code:

// App.js

import React from "react";

const Test = React.lazy(() => {
  import("./components/Test");
});

function App() {
  return (
    <div className="App">
      <Test />
    </div>
  );
}

export default App;


and this is my Test.js code:

import React from "react";

const Test = () => {
  return <div>test</div>;
};

export default Test;

very simple, but when I run npm start this is my console error:

react.development.js:1361 Uncaught TypeError: Cannot read properties of undefined (reading 'then')
    at lazyInitializer (react.development.js:1361:1)
    at mountLazyComponent (react-dom.development.js:20763:1)
    at beginWork (react-dom.development.js:22422:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js:4161:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4210:1)
    at invokeGuardedCallback (react-dom.development.js:4274:1)
    at beginWork$1 (react-dom.development.js:27405:1)
    at performUnitOfWork (react-dom.development.js:26513:1)
    at workLoopSync (react-dom.development.js:26422:1)
    at renderRootSync (react-dom.development.js:26390:1)

I can't understand where I'm wrong. Any ideas? thx all!

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!