I had it because I had both app and pages routers pages, and was using a shared component among them which needed the use client directive for the app router pages as it was using next/navigation router, once added I no longer got the error
use client