You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
however, source is not suggested when i access createUrl.error.data?.zodError?.fieldErrors.
Describe the solution you'd like to see
if this helper function could read the input fields, the problem would be solved:
/**
* 2. INITIALIZATION
*
* This is where the tRPC API is initialized, connecting the context and transformer. We also parse
* ZodErrors so that you get typesafety on the frontend if your procedure fails due to validation
* errors on the backend.
*/
const t = initTRPC.context<typeof createTRPCContext>().create({
transformer: superjson,
errorFormatter({ shape, error }) {
return {
...shape,
data: {
...shape.data,
zodError:
error.cause instanceof ZodError ? error.cause.flatten() : null,
},
};
},
});
Describe alternate solutions
if anyone have other solutions or alternatives, i'd really appreciate it.
Additional information
No response
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
when i want to access the field errors, i don't get type suggestion.
for instance in this router:
i want to check errors for the input validations:
however, source is not suggested when i access createUrl.error.data?.zodError?.fieldErrors.
Describe the solution you'd like to see
if this helper function could read the input fields, the problem would be solved:
Describe alternate solutions
if anyone have other solutions or alternatives, i'd really appreciate it.
Additional information
No response
The text was updated successfully, but these errors were encountered: