Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Conform · Function

conformZodMessage

conformZodMessage provides special messages that control how Conform handles Zod validation. It supports skipping a check while keeping the previous result or marking validation undefined so Conform falls back to the server.

How it works

The conformZodMessage object provides special Zod messages that control whether Conform keeps a prior validation result or falls back to server validation. Assign these constants as validation messages when implementing async or conditionally deferred checks.

Syntax

conformZodMessage.VALIDATION_SKIPPED
conformZodMessage.VALIDATION_UNDEFINED

Returns

An object containing the special Zod validation messages VALIDATION_SKIPPED and VALIDATION_UNDEFINED.

Key points

  • The API is a collection of reserved messages that alter Conform's handling of Zod validation outcomes.
  • Use the messages when a field's validation depends on asynchronous work.
  • VALIDATION_SKIPPED tells Conform not to perform the current validation path.
  • After a skipped validation, Conform preserves the prior validation result.
  • VALIDATION_UNDEFINED represents a validation state that has not been resolved.
  • An undefined validation result delegates the unresolved check to server-side validation.

Common mistakes

  • Use VALIDATION_SKIPPED to tell Conform to skip the current validation and retain the previous result.
  • Use VALIDATION_UNDEFINED when the validation is not defined and should be handled by server validation.

Example: Defer an async Zod validation

import { z } from 'zod';
import { conformZodMessage, parseWithZod } from '@conform-to/zod';

const schema = z.object({
  email: z.string().email().refine(
    async (email) => email !== 'taken@example.com',
    { message: conformZodMessage.VALIDATION_UNDEFINED },
  ),
});

const result = parseWithZod(new FormData(), { schema });
console.log(result);

Use the special undefined-validation message on an async check so Conform defers that validation to the server.

When to use it

Async field validation

A field check requires asynchronous work.

Preserve a previous result

A current validation should not replace an existing outcome.

Defer to server validation

The client cannot determine a validation result and needs authoritative server handling.

Interview questions

QWhat is conformZodMessage used for?

conformZodMessage is a set of special messages for controlling Conform's validation behavior. Its documented constants include VALIDATION_SKIPPED and VALIDATION_UNDEFINED.

Follow-up: How would you defer an async field check? Return VALIDATION_UNDEFINED as the check's validation message so Conform falls back to server validation.

QWhat does VALIDATION_SKIPPED do?

VALIDATION_SKIPPED indicates that the current validation should be skipped. Conform uses the previous validation result instead.

Follow-up: When is this useful? It is useful when the current validation should not replace an already available result, such as when avoiding unnecessary schema work.

QWhat does VALIDATION_UNDEFINED do?

VALIDATION_UNDEFINED marks validation as not defined for the current situation. Conform then falls back to server validation rather than treating the result as a normal validation outcome.

Follow-up: How does this support async validation? An async-dependent check can emit this marker, allowing server-side validation to perform the authoritative check.

  • parseWithZod
  • @conform-to/zod
  • VALIDATION_SKIPPED
  • VALIDATION_UNDEFINED

Source: conformZodMessage. Checked 2026-10-15.