Type Inference from `createServerFn`
Seemingly having an issue that is similar to https://github.com/TanStack/router/issues/5788 however there is no hint that it deals with the return type involving functions which are not serializable. Some context:
The server function:
Part of the TS error:
Seems to be an issue with how Typescript is inferring the response structure by expanding all nested types. Not 100% positive on the best approach here. Is there a means to type cast in order to have it infer the return as something like
Promise<Stripe.Customer | null>? I know that is not ideal, so just reaching out in case others have run into this and if there are any suggestions!1 Reply
correct-apricot•2d ago
can you provide the full TS error and a minimal complete reproducer project?