Debugging works fine with pages like pages/about.js but not with dynamic ones like pages/post/[id].js.
pages/index.js, somewhere in the render method.pages/post/[id]/index.js.NODE_OPTIONS="--inspect" next.UPDATE: This sample repo contains VSCode launch config: https://github.com/borekb/nextjs-issue-8295-demo.
Both breakpoints should be hit.


I tried creating custom _app.js and breakpoints work fine there too. I only seem to have problems with dynamic routes – is it possible that the sourcemaps are somehow incorrect?
It's likely a problem with sourcemaps:

Another small piece, this time from Chrome's console:

In sources:

The file should be pages/post/[id].js.
Same for me, could we get an answer, please?
After adding the breakpoints on the Chrome's source tab, I'm able to debug the client-side code, but not the server-side (in getInitialProps)
Anyone have a working solution to this? Putting debugger statements for every breakpoint is pretty annoying
@willwill96 it was re-raised here https://github.com/vercel/next.js/issues/15823
Most helpful comment
Another small piece, this time from Chrome's console:
In sources:
The file should be
pages/post/[id].js.