Next.js Discord

Discord Forum

How to debug

Unanswered
Dutch posted this in #help-forum
Open in Discord
DutchOP
I m trying to debug both server and client but seem like breakpoints are not being hit for some reason

my current configuration is this one

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Next.js: debug server-side",
            "type": "node-terminal",
            "request": "launch",
            "cwd": "${workspaceFolder}",
            "command": "bun run devturbo" // tried with dev as well
        },
        {
            "name": "Next.js: debug client-side",
            "type": "chrome",
            "request": "launch",
            "url": "http://localhost:3000"
        },
        {
            "name": "Next.js: debug full stack",
            "type": "node-terminal",
            "request": "launch",
            "command": "bun run devturbo", // tried with npm as well
            "cwd": "${workspaceFolder}",
            "serverReadyAction": {
                "pattern": "- Local:.+(https?://.+)",
                "uriFormat": "%s",
                "action": "debugWithChrome"
            }
        }
    ]
}


as followed in the next documentation https://nextjs.org/docs/pages/building-your-application/configuring/debugging#debugging-with-vs-code

On package.json I have this

"scripts": {
        "dev": "cross-env NODE_OPTIONS=--inspect next dev",
        "devturbo": "cross-env NODE_OPTIONS=--inspect next dev --turbo",
        "devsafe": "rm -rf .next && cross-env NODE_OPTIONS=--no-deprecation next dev",
        "build": "cross-env NODE_OPTIONS=--no-deprecation next build"
}


current packages versions:

"@payloadcms/next": "3.0.0-beta.36",
"next": "15.0.0-rc.0",
"payload": "3.0.0-beta.36",
"react": "19.0.0-rc-f994737d14-20240522",`


OS: Windows

What am i missing?

Thanks

3 Replies

DutchOP
D:\repositories\majestico\maia>bun run dev
$ cross-env NODE_OPTIONS='--inspect' next dev
Debugger attached.
Debugger listening on ws://127.0.0.1:9229/3b542045-90a1-428d-8f06-46b5ec401ec9
For help, see: https://nodejs.org/en/docs/inspector
Debugger listening on ws://127.0.0.1:9230/eee5f2de-644e-4835-9aed-5837dbdd9a6e
For help, see: https://nodejs.org/en/docs/inspector
   the --inspect option was detected, the Next.js router server should be inspected at 9230.
  ▲ Next.js 15.0.0-rc.0
  - Local:        http://localhost:3000
  - Environments: .env
  - Experiments (use with caution):
    · reactCompiler

 ✓ Starting...
 ✓ Ready in 2.4s
 ○ Compiling / ...
 ✓ Compiled / in 11.4s (5294 modules)


Also tried with pnpm and npm, nothing changes, breakpoints are not being hit
both breakpoints on the server and client are not being hit