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

305
Vistas
TypeError: __WEBPACK_IMPORTED_MODULE_0_vue___default.a is not a constructor - for upgrading vue 2.0 to vue 3

I am migrating my application vue 2.0 to vue 3.0 . By following the guide, i have done the changes and it is compiled successfully. But, i am getting error in snackbar component. While checking the issue, it was because new Vue() instance. I have upgraded that app Vue 3.0. I am not able to understand how to resolve that.

Here is my snackbar event js file. Where i was initialized the vue instance.

    import Vue from 'vue'
const events = new Vue();
export default events

This is the snackbar's index.js for reference.

    import urSnackbar from "./urSnackbar.vue";
import snacbkarEvent from "./snackbarEvents";
export default {
    install(Vue){
        Vue.component(urSnackbar.name, urSnackbar);

        if (this.installed) {
            return
        }

        this.installed = true;

        const showSnackbar = (params) => {
            if (typeof params === 'string') {
                params = { title: '', text: params }
            }

            if (typeof params === 'object') {
                snacbkarEvent.$emit('show-snackbar', params);
            }
        };
        const addSnackbar = (params) => {
            if (typeof params === 'string') {
                params = { title: '', text: params }
            }

            if (typeof params === 'object') {
                snacbkarEvent.$emit('add-snackbar', params);
            }
        };
        Vue.prototype.$showSnackbar = showSnackbar;
        Vue.prototype.$addSnackbar = addSnackbar;
    }
};

This issue reflected while changing the configuration in vue.config.js to resolve the warnings for migration process.

What i changed in vue.config.js for which this issue occurred

configureWebpack: {
resolve: {
  alias: { vue$: 'vue/dist/vue.esm-bundler.js' } } ..... } 

Previously, It was (vue$: '@vue/compat') so i got multiple warnings. For those, i changed as above.

Can you tell me how i can resolve this issue?

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