Type Inference Issue with catchTags in TypeScript

I can't understand why this function is being inferred as 'Effect<Response, unknown, unknown>' when all the params are well known.
export const DELETE = guestRoute(
  (context) =>
    Effect.gen(function* (_) {
      const user_id = context.props.user.id;
      const { photo_id } = yield* parseParams(context, deleteParamsSchema);
      yield* P.PhotoService.delete(photo_id, user_id);
      return new Response(null, { status: 200 });
    }).pipe(
      Effect.flatMap(() =>
        Effect.catchTags({
          PhotoNotOwned: () => Effect.fail(new Unauthorized()),
          PhotoNotFound: () => new Response(null, { status: 404 }),
        }),
      ),
    ),
  ServerRuntime,
);

If I remove the catchTags part, then it is inferred as: Effect<Response, InvalidParams | Defect | PhotoNotFound | PhotoNotOwned, PhotoService> which is correct
Was this page helpful?