Effect CommunityEC
Effect Community9mo ago
9 replies
leonitous

Language Server Error: Missing Error Type in Pipeline

I wrote some code which looks like this screenshot, the language server is (incorrectly) telling me that
E
is missing from the error channel but I flatten in the pipeline part of the fnUntraced. This just seems like a corner case that I should easily refactor my code to change, as I'm not sure if the language server plugin could check the return type of fnUntraced after the pipeline step instead of before(? idk if that even makes sense), this was just my immediate thought for an implementation. Here is a tiny reproduction:

export const a: <X, E>(exit: Exit.Exit<X, E>) => Effect.Effect<void, E> = Effect.fnUntraced(
    function* <X, E>(exit: Effect.Effect<X, E>) {
        return exit;
    },
    Effect.flatten,
    Effect.asVoid
);
Screenshot_2025-04-22_at_1.39.19_PM.png
Was this page helpful?