Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
How to debug NextJS during the build phase

My nextJS app have a path with 50k plus pages. Running with npm run dev it works fine, but during build it gives me an error TypeError: Cannot read property 'page' of undefined at exportPaths.filter.route That is weird, because I know how many paths I am trying to do (56,427) and they are fine. I would really like to see where I messed up, but I can't launch a debugger for build stage ending with 'Starting inspector' multiple messages. I have tried other ways, but with no success.

Here is my config, which is pretty obsolete, but seems straightforward:

{
            "type": "node",
            "request": "launch",
            "name": "Next: Node",
            "runtimeExecutable": "${workspaceFolder}/node_modules/next/dist/bin/next",
            "env": {
                "NODE_OPTIONS": "--inspect"
            },
            "args": ["build"],
            "port": 9229,
            "console": "integratedTerminal"
        }

P.S. Debugging npm run dev works fine P.P.S. trying to 'listen' to the debugger in VS Code and launching debugger from command line, like in here https://nextjs.org/docs/advanced-features/debugging gives me the same problems.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!