Type-level error when using a child `HttpApi` with `addHttpApi` despite runtime success

Using a child HttpApi "AnotherApi" (added to the root MyApi HttpApi with addHttpApi) throws a type-level error but works fine at runtime when referencing that AnotherApi in the implementation Layer

repro here, I had to add a @ts-expect-error so that TS ignores it and successfully compiles/runs the program:
https://effect.website/play#daa4dd2b618a

the only change is this:

const PeopleLive = HttpApiBuilder.group(
-  MyApi,
+  AnotherApi,
  "people",
  (handlers) => handlers.handle("list", (_) => Effect.succeed([new User({ id: 1, name: "John" })]))
)


the point is to properly split up a large API into smaller child APIs, as it was intended I think with addHttApi
Was this page helpful?