I have a project NextJS 15.1.4 that was throwing this error (Typescript & utilizing app router) ended up creating a pages folder with an empty file .keep. Upon re-running next build the error went away.
app router
pages
.keep
next build