i ran into an error on my Nextjs project and i don’t know how to fix it since it’s not my fault.
Main problem
This error: ./node_modules/next/dist/server/lib/router-utils/filesystem.d.ts:65:72 Type error: '>' expected
is returned once i use "npm run build", the body of it is:
63 | dynamicRoutes: FilesystemDynamicRoute[];
64 | nextDataRoutes: Set<string>;
> 65 | exportPathMapRoutes: undefined | ReturnType<typeof buildCustomRoute<Rewrite>>[];
| ^
66 | devVirtualFsItems: Set<string>;
67 | prerenderManifest: PrerenderManifest;
I tried to run "npm upgrade", updating Nodejs (actually at 23.3.0, also tried to use an LTS version) since two day to see if any changes happened to next module, nothing happened at all, and i don’t know how to fix this.
2
Answers
Downgrading to 14.2.20 worked for me
Note none of the 15 subversions seemed to work through 15.0.4.
What’s your TypeScript version? I had these issues on TS 4.5.0; upgrading to TS 5.0.0+ worked.