Next.js Discord

Discord Forum

Attempted import error: 'FormProvider' is not exported from 'react-hook-form'

Unanswered
malezjaa posted this in #help-forum
Open in Discord
I found a lot of issues on github, but none of the solutions worked. I tried upgrading next (next@14.2.0-canary.11), removing .next, adding --turbo.

This is the only place I am importing FormProvider

import {
  Controller,
  ControllerProps,
  FieldPath,
  FieldValues,
  FormProvider,
  useFormContext,
} from 'react-hook-form';

const Form = FormProvider;

// form component from shadcn


export {
  useFormField,
  Form,
  FormItem,
  FormLabel,
  FormControl,
  FormDescription,
  FormMessage,
  FormField,
};


I am using this in my ui package

1 Reply

Scottish Fold
For me works fine with react-hook-form 7.50.1