Replies: 1 comment 1 reply
-
Yes I'm hoping that #3849 will get merged and zod branded types will be supported from server functions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How can I avoid this error when I use Branded Types?
Here is a minimal reproduce-able code :
And the error is:
Argument of type '() => { id: string & z.BRAND<"FooId">; }' is not assignable to parameter of type 'ServerFn<"GET", undefined, undefined, { id: string & BRAND<"FooId">; }>'. Type '{ id: string & BRAND<"FooId">; }' is not assignable to type '{ id: { readonly [x: number]: string; toString: "Function is not serializable"; charAt: "Function is not serializable"; charCodeAt: "Function is not serializable"; concat: "Function is not serializable"; ... 46 more ...; [BRAND]: { ...; }; }; } | Promise<...>'.
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions