Type Mismatch in Effect Return Type

Hey i just started to use effect, so i have this basic code

class FileSystemError extends Data.TaggedError("FileSystemError")<{
  message: string;
}> {}

const ensureFoundryConfigExists = (basePath: string) => {
  const foundryTomlPath = path.join(basePath, "foundry.toml");
  if (!fs.existsSync(foundryTomlPath)) {
    return Effect.fail(
      new FileSystemError({
        message: "Foundry Configuration not found",
      }),
    );
  }
  return Effect.succeed(foundryTomlPath);
};


I expect the return type of function to be

const ensureFoundryConfigExists: (basePath: string) => Effect.Effect<string, FileSystemError, never>


but instead i get

const ensureFoundryConfigExists: (basePath: string) => Effect.Effect<never, FileSystemError, never> | Effect.Effect<string, never, never>
Was this page helpful?