I ran into this error because I was using an outdated version of NextJS:
I upgraded to v 14.2.6 and the error went away.