Breakpoints aren't working with Next.js app
See original GitHub issueIssue
I am unable to get a breakpoints to work in a next.js application.
Here’s my current firefox configuration:
{
"type": "firefox",
"request": "launch",
"name": "Debugger:firefox",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"skipFiles": [
"node-modules/**"
],
"clearConsoleOnReload": true,
}
This properly launches a firefox instance against localhost, however, when I attempt to add a breakpoint in my editor, I end up seeing this popup in my editor:
Selecting ‘yes’ for the path mapping wizard does nothing.
Here’s my working chrome configuration for comparison:
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}",
"sourceMaps": true,
"smartStep": true,
"skipFiles": [
"node-modules/**",
"interpreter.js"
]
}
Suggestion
This is a bare bones next.js app. Since next.js is becoming more of a popular React.js framework, it might be helpful to have an example in the documentation (provided that this extension is compatible).
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
debugging - Why are breakpoints never working in nextjs class?
You first paint is done on node server. so you need to pass --inspect flag to debug the app. Refer: nextjs debugging, nodejs...
Read more >Advanced Features: Debugging - Next.js
Debugging. This documentation explains how you can debug your Next.js frontend and backend code with full source maps support using either the VS...
Read more >Debugger thinks the code is further along than where it is ...
In my package.json and running npm run dev. This is the standard method to debug NextJS apps. Again, it works fine on my...
Read more >Navigate through code by using the Visual Studio debugger
You can use keyboard shortcuts, debug commands, breakpoints, ... To break into the next available line of code in a running app, ...
Read more >Debugging configurations for Python apps in Visual Studio Code
For general debugging features such as inspecting variables, setting breakpoints, and other activities that aren't language-dependent, review VS Code debugging.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Its working better for me too
@hbenl Looks like it’s working much better! I just tested it out in the same app and was able to get it up and running with my previous configuration, with only one additional path map (I was able to use the Path Mappings Wizard for this).
Excited to use this in future projects! Thanks so much for the hard work.