How do I include helper/utils functions in nestjs?

Viewed 357

I was wondering if there's a specific way to use/implement helper/util functions in NestJS. I have a serverless project and I had a coupe functions inside my service file and decided to move them out of there and put them in a helpers folder. The same thing with enums, I moved them into their own folder so my project looks like this:

src
  -helpers
    -functionIWantToUse.ts
    -index.ts
  -enums
    -allmyenums.ts
    -index.ts
  -tickets
    -ticket.service.ts
    -ticket.controller.ts
    -ticket.module.ts

I'm doing barrel export for the helper and the enums, importing them like a regular function but when I hit the endpoint I get the following error:

āœ– offline: one of the module nesting handler for handler handler is undefined or not exported

āœ– Error: offline: one of the module nesting handler for handler handler is undefined or not exported

It's worth mentioning that everything was working fine before I put the functions in a different folder

0 Answers
Related