Why `NodeRuntime.runMain` Requires `// @ts-expect-error` in TypeScript

Why does NodeRuntime.runMain need // @ts-expect-error (below the code)?

Else it shows this an error on my server https://github.com/guillempuche/effect_server_react/blob/main/apps/server/src/main.ts#L76:
Argument of type 'RunMain' is not assignable to parameter of type '(_: Effect<never, ServeError | ConfigError, RepoAuthor | SqlAuthor | Client>) => void'.
  Types of parameters 'effect' and '_' are incompatible.
    Type 'Effect<never, ServeError | ConfigError, RepoAuthor | SqlAuthor | Client>' is not assignable to type 'Effect<never, ServeError | ConfigError, never>'.
      Type 'RepoAuthor | SqlAuthor | Client' is not assignable to type 'never'.
        Type 'RepoAuthor' is not assignable to type 'never'.ts(2345)


My code is inspired by
https://gist.github.com/ecyrbe/26e4f8ed8a68bd73e8b3575481f55775#file-note-api-ts-L230 that is:
/**
 * Run the application
 */
app.pipe(
  Effect.flatMap(NodeServer.listen({ port: 3000 })),
  Effect.provide(NoteRepositoryService.pipe(Layer.provide(SqliteService))),
  // @ts-expect-error
  Effect.provide(OpenTelemetryService),
  // @ts-expect-error
  NodeRuntime.runMain
);
Was this page helpful?