Effect CommunityEC
Effect Community2y ago
14 replies
Guilty Pleasure

Schema inferring type, Simplify<S.ToStruct<Fields>> instead

I have a typescript project where I want to use @effect/schema/Schema to validate my types. However when I try to use S.parse or S.Schema.To<typeof mySchema> all I get is a typedefinition as this: Simplify<S.ToStruct<Fields>>

tsconfig.json
{
  "compilerOptions": {
    "strict": true,
    "module": "commonjs",
    "esModuleInterop": true,
    "target": "es2017",
    "exactOptionalPropertyTypes": true,
    "noImplicitAny": true,
    "moduleResolution": "node",
    "sourceMap": true,
    "outDir": "dist",
    "baseUrl": ".",
    "paths": {
      "*": [
        "node_modules/*",
        "src/types/*"
      ]
    }
  },
  "include": [
    "src/**/*"
  ]
}


package.json
  "dependencies": {
    "@effect/match": "^0.35.2",
    "@effect/schema": "0.36.5",
    "effect": "^2.4.1",
  },


Does anyone know why I can't get the expected type inference?
Was this page helpful?