Closed SeveHo closed 2 years ago
Hi @SeveHo 👋
I'm not sure that the problem comes from the injection of the PusherService
. Is it possible that you have circular ES6 imports? For example the file owning the PusherService
imports the constant REDACTED_CONFIG
from a file X
which imports directly or indirectly something from the file PaymentService
?
Hey, if I disable the injection everything works fine. Also the config is just an object with string attributes.
Do you use default exports or named exports? If you use default exports, moving to named exports might solve the problem.
Named exports. Weirdly changing the services/index.ts
from
export { PusherService } from "./pusher.service";
to
import { PusherService } from "./pusher.service";
export { PusherService };
resolves the error. Can you explain why that is?
Unfortunately, I don't really know where it comes from (maybe a change in your tsconfig.json
?). It's like PusherService
was found as undefined
when providing it with @dependency push: PusherService
.
I'm closing the issue as it has been resolved with the solution you found. I'm sorry that I could not find out what happened though 😕
Version of FoalTS: 2.6.0
Hi @LoicPoullain,
I have a similar problem like https://github.com/FoalTS/foal/issues/488, but not exactly the same. I import one service in an other service:
and in my PusherService is simply do
So I am not referencing circular but I still get the same error:
Do you see what I am doing wrong or is this a bug? Weirdly only the PusherService is causing this problem but the LoggerService works fine.