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

889
Vistas
require is not defined with dayjs in vite

I need to use the dayjs library in my Vue application but Vite does not allow me to use require as specified in the dayjs documentation. I searched a lot on the web but the little solution I could find didn't work. Do you have a solution to fix this ?

Thanks in advance 😊

here is the file i am importing from :

import dayjs from 'dayjs';

const isoWeek = require('dayjs/plugin/isoWeek');
dayjs.extend(isoWeek);
const utc = require('dayjs/plugin/utc');
dayjs.extend(utc);

the error message in the console :

vue-router.esm-bundler.js:3308 
ReferenceError: require is not defined
    at index.js:3:17
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