Skip to content

Erratic debugging/breakpoint behavior with turbopack (and Cursor?) #79424

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

Open
bernatfortet opened this issue May 20, 2025 · 0 comments
Open
Labels
Turbopack Related to Turbopack with Next.js.

Comments

@bernatfortet
Copy link

bernatfortet commented May 20, 2025

Link to the code that reproduces this issue

https://github.com/bernatfortet/reproduction-app

To Reproduce

In the reproduction app I've changed:

  1. The script dev to use turbopack: "dev": "next dev --turbopack"
  2. a .vscode/launch.json file and add what the Guides: Debugging page mentions to use for debugging with next.js
  3. In src/app/page.tsx add a console log right below the Home function:
export default function Home() {
  console.log(`Add brakepoint in this line`)
  ...
  1. Add a breakpoint to the console log
Image
  1. Refresh OR add a letter to the log and save.

Current vs. Expected behavior

Expected behavior: The breakpoint stops on the console log consistently on every refresh.

Behavior 1:

  • Breakpoint works well, I click continue and it's fine.
  • But if I change the text in the console it trigger behavior 2

Behavior 2:

  • After reloading
  • Breakpoint works well
  • But when I "Continue" executing the code
Image - I'm sent to some cryptic part of the code Image

Behavior 3:
Image

  • After the breakpoint has been set, refreshing the page doesn't trigger anything.
  • (is this because of caching?

Provide environment information

Node.js v23.3.0

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10
Binaries:
  Node: 23.3.0
  npm: 10.9.0
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 15.4.0-canary.43 // Latest available version is detected (15.4.0-canary.43).
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: 5.8.3
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

@github-actions github-actions bot added the Turbopack Related to Turbopack with Next.js. label May 20, 2025
@bernatfortet bernatfortet changed the title Erratic debugging/breakpoint behavior with turbopack Erratic debugging/breakpoint behavior with turbopack (and Cursor?) May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Turbopack Related to Turbopack with Next.js.
Projects
None yet
Development

No branches or pull requests

1 participant