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

273
Views
javascript not a constructor exception while creating objects in node_modules

I am facing any issue in react. Here How I am defining the class BackendServiceClient

class BackendServiceClient {
  private readonly source: string;

constructor(source?: string) {
    if (source) {
      this.source = source;
    }
    axios.defaults.headers = this.setDefaultHeaders();
  }
}
.... some logic

export default BackendServiceClient;

This how the BackendServiceClient is export in index.ts in common library in this class we export all the vars that could be used by clients of the library

export { default as BackendServiceClient} from './api/BackendServiceClient';

While building this commons library into my application I got error commons.BackendServiceClient is not constructor

and when checked the line causing errors from file in node modules


backendServiceClient: /*#__PURE__*/new commons.BackendServiceClient(),

Does someone have faced this issue ? Thanks

almost 4 years ago · Santiago Trujillo
2 answers
Answer question

0

In JavaScript, objects are created using functions and methods. This programming language allows defining construction functions that act as templates for the creation of objects. These constructor functions can have associated properties and methods that are inherited through the objects created from them. In this way, JavaScript makes it easy to create and manipulate objects efficiently and flexibly.

almost 4 years ago · Santiago Trujillo Report

0

NODE JS is a programming language that allows you to create objects and also provides some functions and methods for them.

almost 4 years ago · Santiago Trujillo 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!