question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot use Zod .transform

See original GitHub issue

Describe the bug Unable to use .transform with the zod resolver

To Reproduce Use an input and see an error image

Codesandbox link (Required) https://codesandbox.io/s/react-hook-form-zod-resolver-example-forked-khj93c?file=/src/App.tsx

Expected behavior The transform happens as expected, and errors thrown during transformation are treated as form errors

Desktop (please complete the following information):

  • OS: MacOS 13 Ventura
  • Browser: Chrome 102.0.5005.61 (Official Build) (arm64)

Additional context Replaces #415 (Error carried forward)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bluebill1049commented, Jun 15, 2022
Screen Shot 2022-06-15 at 12 45 35 pm

This is the error log that I am getting.

0reactions
jorisrecommented, Sep 12, 2022

Please open a new issue thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC: Refactoring transformers and Zod 3 · Issue #264 - GitHub
TLDR Transformers are poorly designed. I want to reimplement them but there will be breaking changes. Under this proposal, Zod 2 will never ......
Read more >
Newest 'zod' Questions - Stack Overflow
I have a zod schema that transforms a string (enum) value into an object. I want to use it with react-hook-forms and the...
Read more >
express-zod-api - npm
A Typescript library to help you get an API server up and running with I/O schema validation and custom middlewares in minutes.
Read more >
Why Zod 2 isn't leaving beta - Colin McDonnell
Transformers are a mechanism within Zod to convert data from one type ... Zod can't know how to magically undo the transformation function....
Read more >
Untitled
You must enable `strictNullChecks` or use `strict` mode which includes `strictNullChecks`. Otherwise Zod can't correctly infer the types of your schemas!
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found