I have an issue with debugging NextJS 12 apps in VSCode. Basically, the breakpoints ain't triggered when reloading in the browser.
- Create the default NextJS 12 app using:
$ npx create-next-app@latest. - Create the
launch.jsonusing https://nextjs.org/docs/advanced-features/debugging:
{
"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:10for 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?