Error with Schema Parsing in Effect's HttpClient: Type Mismatch in `Effect.andThen`

Quick question regarding Effect's Schemas:

I'm building a way to use Schema parsing in Effect's HttpClient like this:

import { HttpClient, HttpClientRequest, HttpClientResponse } from "@effect/platform"
import { Effect } from "effect";
import * as S from "@effect/schema/Schema";

export const fetchEffect = <T>(schema: S.Schema<T>) => (url: string) =>
    HttpClientRequest.get(url).pipe(
        HttpClient.fetch,
        Effect.andThen(HttpClientResponse.schemaBodyJson(schema)),
        Effect.scoped
    )


But for some reason, I get an error at Effect.andThen(HttpClientResponse.schemaBodyJson(schema)):

Argument of type 'Schema<T, T, never>' is not assignable to parameter of type 'Schema<unknown, unknown, unknown>'.
  Property '[TypeId]' is missing in type 'Schema<T, T, never>' but required in type 'Schema<unknown, unknown, unknown>'.ts(2345)
Schema.d.ts(132, 18): '[TypeId]' is declared here.


I'm not too sure why this is happening. Any idea why that could be?
Was this page helpful?