RELKIT_SCHEMA_UNAVAILABLE
A schema in your app cannot be described as JSON Schema, so RelKit cannot build its API description.
relkit check reports this error when a function, event, task, error or agent uses a schema that RelKit cannot turn into JSON Schema. RelKit needs JSON Schema to write the OpenAPI document, the typed client and the tool descriptions agents see.
src/services/orders/functions/create-order.function.ts:6:3 - error RELKIT_SCHEMA_UNAVAILABLE: input cannot produce deterministic JSON Schema: Schema does not expose a deterministic projection.
docs: https://relkit.dev/docs/errors/relkit-schema-unavailable
Supported schema libraries
RelKit accepts any Standard Schema validator. It reads JSON Schema from the first source that works, in this order:
- RelKit’s built-in builder from
@relkit/app/schema. - The schema’s own
~standard.jsonSchemahook, for the input or output side as needed. - A converter for the schema’s library, loaded only when a schema from that library appears.
| Library | Version | What to install |
|---|---|---|
| Zod | 4.2+ | zod. Its schemas describe themselves. |
| ArkType | 2 | arktype. Its schemas describe themselves. |
| Valibot | 1 | valibot and @valibot/to-json-schema, which RelKit loads as a converter. |
| Effect Schema | 4 | effect. RelKit uses Effect’s own JSON Schema converter. |
| Any other library | — | Works when its schemas implement ~standard.jsonSchema. |
The installed version of each library is part of your build’s fingerprint, so upgrading one makes the next relkit check describe its schemas again.
Why it happens
- The schema comes from a library that has no JSON Schema hook and no converter RelKit knows, such as Zod 3 or Yup.
- The schema is from Valibot, but
@valibot/to-json-schemais not installed. - The schema uses a feature JSON Schema cannot express, such as a custom refinement function, a
Date, abigint, aMapor a transform with no JSON form. The message ends with the library’s own explanation.
What to do
-
Read the end of the message: it names the schema and the reason.
-
If the library is not in the table, switch that contract to a supported library. Zod 4 is the default in new projects.
-
For Valibot, install the converter:
bun add @valibot/to-json-schema -
If the schema uses a type JSON Schema cannot express, describe the wire value instead (for example an ISO date string rather than a
Date) and convert it inside your handler. -
Run
bun run checkagain.
See Schemas for how RelKit uses schemas, and all error codes.