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

290
Vistas
client.js?06a0:103 TypeError: _assets_js_Product_js__WEBPACK_IMPORTED_MODULE_0__.Product is not a constructor in VueJs

I'm trying to use some OOP JS in my vue project, i made a very basic class but when trying to make a new object I get the following error:

client.js?06a0:103 TypeError: _assets_js_Product_js__WEBPACK_IMPORTED_MODULE_0__.Product is not a constructor

The class looks like this:

export default class Product {
  name;
  steps;
  model;
  control;
  montage;
  etage;
  dimensions;

  constructor(name) {
    this.name = name;
  }
}

In my component I import the class like this:

import { Product } from '~/assets/js/Product.js'

And then i try to create the object like this:

const product = new Product('markiezen');

I don't understand what i'm doing wrong here i've done OOP in Java but not in Javascript before but for what i've read so for this should work but it doesn't what am i missing?

about 4 years ago · Santiago Gelvez
1 Respuestas
Responde la pregunta

0

When exporting a default from a module, the import name should not be wrapped in curly braces {}. Instead, just import like so:

import Product from '~/assets/js/Product.js'

Alternatively, you can remove the default from the export default class Product line.

about 4 years ago · Santiago Gelvez Denunciar
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