Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

325
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda