Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Server-side debugger doesn't stop in breakpoints after v15.0.3-canary.7 #73214

Open
emilioestebanez opened this issue Nov 26, 2024 · 6 comments
Labels
bug Issue was opened via the bug report template. Turbopack Related to Turbopack with Next.js.

Comments

@emilioestebanez
Copy link

emilioestebanez commented Nov 26, 2024

Link to the code that reproduces this issue

https://github.com/emilioestebanez/next-15-debugging-issue

To Reproduce

  1. Open in VSCode
  2. Go to Run and Debug and execute the Next.js: debug server-side
  3. Set a breakpoint in src/app/page.tsx
  4. Visit http://localhost:3000

You'll see that the debugger doesn't stop in the breakpoint in Windows.

Now, if you go to package.json and remove --turbopack from the dev script and try the steps above again, you'll see that the debugger is able to stop in the breakpoint correctly.

This happens after next@15.0.3-canary.7

Current vs. Expected behavior

I expect the breakpoint to stop with and without --turbopack enabled.

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 65208
  Available CPU cores: 20
Binaries:
  Node: 20.18.0
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: 9.12.3
Relevant Packages:
  next: 15.0.3 // Latest available version is detected (15.0.3).
  eslint-config-next: 15.0.3
  react: 19.0.0-rc-66855b96-20241106
  react-dom: 19.0.0-rc-66855b96-20241106
  typescript: 5.7.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Turbopack

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

I think this is the cause of the issue:
#71984

@emilioestebanez emilioestebanez added the bug Issue was opened via the bug report template. label Nov 26, 2024
@github-actions github-actions bot added the Turbopack Related to Turbopack with Next.js. label Nov 26, 2024
@emilioestebanez emilioestebanez changed the title Server-side debugger doesn't stop after v15.0.3-canary.7 Server-side debugger doesn't stop in breakpoints after v15.0.3-canary.7 Nov 26, 2024
@michaelschufi
Copy link

I've checked out the repo because it was mentioned in #73258.

It's working inside WSL 2 (Linux, see below) but not on Windows 10 itself.
I've also tried the canary version, which has the same issue.

Canary version tested 🔢

"dependencies": {
  "react": "19.0.0-rc-b01722d5-20241114",
  "react-dom": "19.0.0-rc-b01722d5-20241114",
  "next": "15.0.4-canary.30"
}

Not working on ❌

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
  Available memory (MB): 32479
  Available CPU cores: 16
Binaries:
  Node: 22.11.0
  npm: 10.9.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.0.4-canary.30 // Latest available version is detected (15.0.4-canary.30).
  eslint-config-next: 15.0.3
  react: 19.0.0-rc-b01722d5-20241114
  react-dom: 19.0.0-rc-b01722d5-20241114
  typescript: 5.7.2
Next.js Config:
  output: N/A

Working on ✅

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024
  Available memory (MB): 15853
  Available CPU cores: 16

@emilioestebanez
Copy link
Author

I've checked out the repo because it was mentioned in #73258.

It's working inside WSL 2 (Linux, see below) but not on Windows 10 itself. I've also tried the canary version, which has the same issue.

Canary version tested 🔢

"dependencies": {
  "react": "19.0.0-rc-b01722d5-20241114",
  "react-dom": "19.0.0-rc-b01722d5-20241114",
  "next": "15.0.4-canary.30"
}

Not working on ❌

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
  Available memory (MB): 32479
  Available CPU cores: 16
Binaries:
  Node: 22.11.0
  npm: 10.9.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.0.4-canary.30 // Latest available version is detected (15.0.4-canary.30).
  eslint-config-next: 15.0.3
  react: 19.0.0-rc-b01722d5-20241114
  react-dom: 19.0.0-rc-b01722d5-20241114
  typescript: 5.7.2
Next.js Config:
  output: N/A

Working on ✅

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024
  Available memory (MB): 15853
  Available CPU cores: 16

Thanks for checking it!

@emilioestebanez
Copy link
Author

emilioestebanez commented Dec 11, 2024

Updated the repo with next 15.1.0, and unfortunately the same issue happens.

@emilioestebanez emilioestebanez changed the title Server-side debugger doesn't stop in breakpoints after v15.0.3-canary.7 [Windows] Server-side debugger doesn't stop in breakpoints after v15.0.3-canary.7 Dec 12, 2024
@Falven
Copy link

Falven commented Dec 13, 2024

@emilioestebanez Worked for me on OS X:

CleanShot 2024-12-13 at 13 43 30@2x

And an API route:

CleanShot 2024-12-13 at 13 46 03@2x

Only other difference is I used pnpm. Switched debug config to pnpm run dev. Not sure why it didn't work with npm, did you try pnpm?

@emilioestebanez
Copy link
Author

@Falven , for me it fails with both npm and pnpm.

@jacksierkstra
Copy link

jacksierkstra commented Dec 21, 2024

I am also facing the problem of unbound breakpoints in Visual Studio Code. I am using Yarn.

Output of next info:

Node.js v22.9.0

Operating System:
  Platform: win32
  Arch: arm64
  Version: Windows 11 Pro
  Available memory (MB): 32072
  Available CPU cores: 12
Binaries:
  Node: 22.9.0
  npm: 10.8.3
  Yarn: 4.5.3
  pnpm: N/A
Relevant Packages:
  next: 15.1.2
  eslint-config-next: 15.1.0
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.2
Next.js Config:
  output: standalone

Relevant scripts section of in package.json:

...
"scripts": {
    "dev": "next dev --turbopack"
}
...

Relevant launch configuration in Visual Studio Code:

...
{
      "command": "yarn run dev",
      "name": "Debug: Next.JS",
      "request": "launch",
      "sourceMaps": true,
      "type": "node-terminal",
      "serverReadyAction": {
        "action": "debugWithChrome",
        "killOnServerStop": true,
        "pattern": "- Local:.+(https?://.+)",
        "uriFormat": "%s",
        "webRoot": "${workspaceFolder}"
      },
      "resolveSourceMapLocations": [
        "${workspaceFolder}/**",
        "!**/node_modules/**"
      ]
    }
...

Whenever I switch back to the normal dev server (without Turbopack, so next dev), breakpoints are being bound and hit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

4 participants