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

343
Vistas
FullCalendar Dynamic Import

I'm trying to import Full Calendar dynamically to only load it when needed and have the following:

    (async () => {
        console.log('Hello 0');
        const Calendar = await import('@fullcalendar/core');
        console.log('Hello 1');
        const { default: dayGridPlugin } = await import('@fullcalendar/daygrid');
        console.log('Hello 2');

        let calendarEl = document.getElementById('calendar')

        let calendar = new Calendar(calendarEl, {
            plugins: [dayGridPlugin]
        });
    })();

I can't see why this is failing. I just get the following error:

vdom.js:3 Uncaught (in promise) Error: Please import the top-level fullcalendar lib before attempting to import a plugin.

Also the "Hello 0" is output but not any of the other console logs.

I'd expect the core library to load, followed by the daygrid plugin, but it appears like the plugin is actually loading first, hence the warning in the error. Isn't the await call next to line 3 meant to ensure that. the core library is fully imported before moving on?

Why is that not happening?

Any suggestions?

about 4 years ago · Juan Pablo Isaza
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