React 19 React Hook Form Issues

hey i've tried implementing React Hook Form following shadcn documentation and components. I continue to get this error and couldn't think about a workaround
Export useForm doesn't exist in target module
22 | } from "../ui/form";
23 | import { zodResolver } from "@hookform/resolvers/zod";
> 24 | import { useForm } from "react-hook-form";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 | import { z } from "zod";
26 | import { api } from "~/trpc/react";
27 |

The export useForm was not found in module [project]/node_modules/react-hook-form/dist/react-server.esm.mjs [app-rsc] (ecmascript).
Did you mean to import set?
All exports of the module are statically known (It doesn't have dynamic exports). So it's known statically that the requested export doesn't exist.
Export useForm doesn't exist in target module
22 | } from "../ui/form";
23 | import { zodResolver } from "@hookform/resolvers/zod";
> 24 | import { useForm } from "react-hook-form";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 | import { z } from "zod";
26 | import { api } from "~/trpc/react";
27 |

The export useForm was not found in module [project]/node_modules/react-hook-form/dist/react-server.esm.mjs [app-rsc] (ecmascript).
Did you mean to import set?
All exports of the module are statically known (It doesn't have dynamic exports). So it's known statically that the requested export doesn't exist.
1 Reply
dillards
dillards3w ago
yo @jonathan did you figure a way around this? having this following form example on https://ui.shadcn.com/docs/components/form
React Hook Form
Building forms with React Hook Form and Zod.

Did you find this page helpful?