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

316
Visualizações
Calling A Function from the main.ts file to other ts file is not working in Node js

I have a project in Node JS with the following structure:

  • ormconfig.js
  • package.json
  • src
    • main.ts
    • user
      • user.module.ts
      • user.entity.ts
      • user.service.ts (include a function "this.reposiroty.find(...)")
    • mailer
      • mailer.module.ts
      • mailer.service.ts
      • mailer.listener.ts ("the problem is here")

"main.ts" calls a function in "mailer.listener.ts", then "mailer.listener.ts" calls in its turn the function FindAlltoAlert in "user.service.ts", accordingly, an error printed to the console (Error: Cannot read property 'find' of undefined), which is generated when "mailer.listener.ts" calls function FindAlltoAlert in "user.service.ts".

Please advise!

about 4 years ago · Juan Pablo Isaza
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