nextjs-routes: Typescript Complaint: Expected 0 type arguments, but got 1
Hi,
I am using the nextjs-routes@0.1.0 with the withRoutes configuration but I am not sure it’s working as expected.
I am seeing the following error

I also cannot see the nextjs-routes nextjs-routes.d.ts types or any addition to my tsconfig.json.
Any ideas what am I missing?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27 (18 by maintainers)
I’m seeing
Could not find a Next.js pages directory.issue as well with a Nx generated Next.js, which doesn’t includepackage.jsonfile in the Next.js folder. I think it would be most straightforward to simply change the API torequire('nextjs-routes/config')(__dirname)Ok, I moved all the next and yarn stuff into the frontend folder and it works
We could consider resolving the pages directory relative to the the next.config.js instead of package.json, which isn’t a big lift after the deprecation of the cli invocation. I’m hesitant to make this a dedication configuration option, because we should be able to find routes identical to next. What do you think @MariaSolOs ?
Cool I will try to move everything down just to check
No I think that’s the problem the yarn and next.config life in the root and the rest is in the front-end folder but I’m sure if I just move everything there it will work. Just wanted to note that maybe it’s not the most uncommon case?
Hi of course. Here is my next.config.js
and yes I am running
next dev