Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

277
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda