Effect CommunityEC
Effect Community11mo ago
28 replies
Dave Meehan

TS4020 errors when using Effect.Service and nested imports

TS4020: extends clause of exported class MyService has or is using private name Channel
TS4020: extends clause of exported class MyService has or is using private name Effect
TS4020: extends clause of exported class MyService has or is using private name NodeInspectSymbol
TS4020: extends clause of exported class MyService has or is using private name Sink
TS4020: extends clause of exported class MyService has or is using private name Stream


I keep running into these errors, and it seems to be linked to the order/nesting of imports. I'm working in a monorepo and previously thought I was ending up with mixed Effect versions, but in this occurrence that's not the case. It seems to crop up when I have a dependency that is imported into the service defining module, and via another import that also uses the same definitions.

It also doesn't seem to be the import itself, but triggered by there being a yield* on a service method that returns an effect. Commenting out that line make the warning go away (but then of course I can't run the effect).

With some juggling I can get them to go away but would be helpful to understand what I might be doing wrong that triggers it. The code still runs fine, its just highlighted as an error in the IDE (Jetbrains).
Was this page helpful?