If you are using server components the add "use client" at the top of component. And I hope It will fix the error.