Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Error onServerValidate async #737

Closed
CoachNooB opened this issue Jun 5, 2024 · 2 comments
Closed

Type Error onServerValidate async #737

CoachNooB opened this issue Jun 5, 2024 · 2 comments

Comments

@CoachNooB
Copy link

Describe the bug

I got red squigly line when putting async in onServerValidate. But it run normally in runtime.
Type Promise <string | undefined> is not assignable to type ValidationError

Your minimal, reproducible example

https://www.typescriptlang.org/play/?#code/PTAEHUFMBsGMHsC2lQBd5oBYoCoE8AHSAZVgCcBLA1UABWgEM8BzM+AVwDsATAGiwoBnUENANQAd0gAjQRVSQAUCEmYKsTKGYUAbpGF4OY0BoadYKdJMoL+gzAzIoz3UNEiPOofEVKVqAHSKymAAmkYI7NCuqGqcANag8ABmIjQUXrFOKBJMggBcISGgoAC0oACCbvCwDKgU8JkY7p7ehCTkVDQS2E6gnPCxGcwmZqDSTgzxxWWVoASMFmgYkAAeRJTInN3ymj4d-jSCeNsMq-wuoPaOltigAKoASgAywhK7SbGQZIIz5VWCFzSeCrZagNYbChbHaxUDcCjJZLfSDbExIAgUdxkUBIursJzCFJtXydaiKKEEeBkGgAb1A7EEkAAYlTEKAAL44thsgBEAAFUGZBILYPFgJNYKhSslWTyANzBBCcYU41mgAC89MZLLIiAAFDTFCUStxIMkGFFUAA1BjQdiQfKgQ3Gl39BjIR08nlG43s3jBF2NYjfPRkG3QCjcOoOsTHcygA2gHS2+0cgCUGoAfE6fa7QCoACIYCpx2CgYNkUOgcORuoNTi5jmKdlp4IqHDNDxkLyIKnOYHsGhfNxmZjsBjMSD8WAR0ViYF6EReHkAUVW7oW+h5SWxPPADlQAHJhAA5SASHlBFQAeS+ZHejP4k6OgupkFc0jwoCcvZ0wyw+goAgiDQsIlzDhIVLRCIBgcNiCxMKwHA8EEihAA

Steps to reproduce

  1. Put async in the onServerValidate
  2. Got Type error

Expected behavior

No Type Error.

How often does this bug happen?

Every time

Screenshots or Videos

image

Platform

  • OS: Windows
  • Browser: OperaGX

TanStack Form adapter

react-form

TanStack Form version

v0.20.2

TypeScript version

v5.4.2

Additional context

No response

@my-slab
Copy link
Contributor

my-slab commented Jul 8, 2024

I had a crack at fixing it in #822.

@Balastrong
Copy link
Member

Implemented in #855

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants