If your nextjs project is working on NX Monorepo solutions. It cannot work because It's looking hardcoded defined paths like "src/pages", "/pages" etc. but NX Monorepo is using like "apps//src/pages" and It doesn't work. NX running commands are only working on root directory. config.tsx line 406 is using process.cwd and it's not supporting custom pages directory
Solution
I added "pagesDirectory" config into harcoded paths and It will work now
Problem
If your nextjs project is working on NX Monorepo solutions. It cannot work because It's looking hardcoded defined paths like "src/pages", "/pages" etc. but NX Monorepo is using like "apps//src/pages" and It doesn't work. NX running commands are only working on root directory. config.tsx line 406 is using process.cwd and it's not supporting custom pages directory
Solution
I added "pagesDirectory" config into harcoded paths and It will work now