David Ávila
David Ávila

Reputation: 11

405 Method not allowed RHF + Server Actions in Next.js and deploying it in Vercel

I watched this video and everything works in dev and local, but I deployed the proyect in vercel and everytime I want to submit the form I get the 405 method not allowed. There are no logs about the error.

const ref = useRef<HTMLFormElement>(null)
...
...
<form
  onSubmit={form.handleSubmit(()=>ref.current?.submit())}
  action={logInAction}
  ref={ref}
/>

I have tried only working with the action, but then i can't validate the data on the client side. I would like to preserve the same behavior of the video

Upvotes: 1

Views: 227

Answers (0)

Related Questions