Breakpoints don't get hit while debugging the client of a NextJS 12 app in VSCode

Viewed 267

I have an issue with debugging NextJS 12 apps in VSCode. Basically, the breakpoints ain't triggered when reloading in the browser.

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Next.js: debug client-side",
      "type": "pwa-chrome",
      "request": "launch",
      "url": "http://localhost:3000"
    }
  ]
}
  • Start the app with $ npm run dev
  • Set a breakpoint at the pages/index.js:10 for example.
  • Run the debug session and see how the breakpoint is getting hit.
  • Now if you reload the page, the breakpoing isn't going to be hit. Why?

The only way to get it triggered again is to restart the debugging session OR edit the file with the breakpoint.

Ideas? Is there a sort of optimization which can be disabled?

0 Answers
Related