This error can be caused by having any route subdirectories within a catch-all route. Do you have any directories within [...nextauth]
?
For instance, someDirectory
in the example below would cause this error:
app
├── [...nextauth]
│ └── route.ts
│ └── someDirectory