Skip to content
Discussion options

You must be logged in to vote

Here how you can define standalone ErrorMap correctly:

-export const errors: ErrorMap = {
+export const errors = {
  INPUT_VALIDATION_FAILED: {
    status: 422,
    data: z.object({
      fieldErrors: z.record(z.string(), z.array(z.string()).optional()),
      formErrors: z.array(z.string()),
    }),
  },
-};
+} satisfies ErrorMap;

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@FLchs
Comment options

Comment options

You must be logged in to vote
5 replies
@FLchs
Comment options

@FLchs
Comment options

@unnoq
Comment options

unnoq Dec 9, 2025
Maintainer

@unnoq
Comment options

unnoq Dec 9, 2025
Maintainer

Answer selected by unnoq
@FLchs
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants