Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

291
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!