📆 Don't miss our Sanity Showcase virtual meetup on March 20th!
@public
interface

FieldError

Represents an error that occurred in a specific field of a data object.

Import

import {type FieldError} from 'sanity'

Signature

interface FieldError {
  error: | IncompatibleTypeError
    | TypeAnnotationMismatchError
    | MissingKeysError
    | DuplicateKeysError
    | UndeclaredMembersError
    | MixedArrayError
  fieldName: string
  key: string
  kind: 'error'
}

Properties

error: | IncompatibleTypeError
  | TypeAnnotationMismatchError
  | MissingKeysError
  | DuplicateKeysError
  | UndeclaredMembersError
  | MixedArrayError
error: | IncompatibleTypeError
  | TypeAnnotationMismatchError
  | MissingKeysError
  | DuplicateKeysError
  | UndeclaredMembersError
  | MixedArrayError

The specific error that occurred.

Possible error types include:
- IncompatibleTypeError
- TypeAnnotationMismatchError
- MissingKeysError
- DuplicateKeysError
- UndeclaredMembersError
- MixedArrayError
fieldName: string
fieldName: string

The name of the field that the error occurred in.

key: string
key: string

The unique identifier for the error.

kind: 'error'
kind: 'error'

The type of error that occurred.

Remarks

This interface is used to provide detailed information about the error, including the field name, the error type, and the error message.

sanity@3.79.0