I solved this problem by redesigning the application architecture using nx and decoupling the connections between services: I moved the common methods into a separate regular ts file, in which these methods simply became pure functions. Thanks to everyone for the answers!