I’ve been trying to set up the debugger for my Next.js project in WebStorm, but it’s not working as expected. I’ve read the Next.js and WebStorm documentation multiple times but couldn’t get it to work.

I set up an NPM run/debug configuration, but breakpoints don’t work correctly. Instead of stopping at the expected breakpoint, the debugger stops at the <main> tag, which shouldn’t happen.
Here’s an example of my configuration:

This is the default NPM configuration that WebStorm generates when creating a Next.js project. I’ve also tried other configurations, but they either don’t work at all or have the same issue.

NODE_ENV=development;NODE_OPTIONS=--inspect
Does anyone know how to properly configure WebStorm’s debugger for Next.js so that breakpoints work correctly? Any help would be greatly appreciated!
Same issue, noticed after updating to Next.js 15 + React 19
Update
btw this config for VS Code work fine with Next.js 15 + React 19 https://github.com/vercel/next.js/issues/62008#issuecomment-1943221232
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With