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

315
Views
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
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!