Type Errors with HttpApiBuilder in template project

Hello! I'm writing here because I'm experiencing a set of strange type errors with the Http API module code in a project that is very close to the starter project with create-effect-app. Before I continue my explanation, I want to say that I'm able to run both the server and the cli without issues, it's only that I'm getting those type errors.

import { HttpApiBuilder } from "@effect/platform"
import { TodosApi } from "@template/domain/TodosApi"
import { Effect, Layer } from "effect"
import { TodosRepository } from "./TodosRepository.js"

const TodosApiLive = HttpApiBuilder.group(TodosApi, "todos", (handlers) => // Property '[TypeId]' is missing in type 'typeof TodosApi' but required in type 'HttpApi<string, Any, unknown, unknown>'
  Effect.gen(function*() {
    const todos = yield* TodosRepository
    return handlers
      .handle("getAllTodos", () => todos.getAll()) // Argument of type '"getAllTodos"' is not assignable to parameter of type 'never'.
      .handle("getTodoById", ({ path: { id } }) => todos.getById(id)) // (Same for every other handle() call)
      .handle("createTodo", ({ payload: { text } }) => todos.create(text))
      .handle("completeTodo", ({ path: { id } }) => todos.complete(id))
      .handle("removeTodo", ({ path: { id } }) => todos.remove(id))
  }))

export const ApiLive = HttpApiBuilder.api(TodosApi).pipe( // Argument of type 'typeof TodosApi' is not assignable to parameter of type 'HttpApi<string, Any, unknown, unknown>'.
  Layer.provide(TodosApiLive)
)


Here is the entire code: https://github.com/SerbanUntu/effectcord.
I really got stuck on this problem. Any help would be highly appreciated
Was this page helpful?