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

[effect-ts] Expected string, actual undefined #706

Open
fredericrous opened this issue Jul 24, 2024 · 1 comment
Open

[effect-ts] Expected string, actual undefined #706

fredericrous opened this issue Jul 24, 2024 · 1 comment

Comments

@fredericrous
Copy link

Describe the bug
using effect-ts resolver,
when I click submit, I get the error "Expected string, actual undefined"
however I expect my custom error to show (which is "name required")

To Reproduce
Steps to reproduce the behavior:

  • use the example provided on the readme, something like
const schema = S.Struct({
  name: S.String.pipe(S.nonEmpty({ message: () => 'name required' })),
})
  • click inside the input text field

    do not write anything in the input field

  • click submit button

    an error shows up: Expected string, actual undefined

Expected behavior
"'name required" should have been shown, but we got "Expected string, actual undefined"

Desktop (please complete the following information):
not relevant but here it is

  • OS: macOS 14.5
  • Browser: chrome
  • Version: 126.0.6478.127

Additional context

"@effect/schema": "^0.68.26",
"@hookform/resolvers": "^3.9.0",
@fredericrous
Copy link
Author

a workaround is to set the default value to an empty string

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

No branches or pull requests

1 participant