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

271
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 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