Solve “Breakpoint ignored” with Visual Studio code (vscode 1.19+) Chrome debugger

Ananto Ghosh
Jan 31, 2018 · 1 min read

In case you are trying to use parcel bundler or any code transformer using the Visual Studio Code (vscode) Chrome Debugger and get

Breakpoint ignored because generated code not found (source map problem?).

You’ll have to make sure that your generated source map points to the correct file paths.

In your launch.js

  • Use webRoot to specify your source folder
  • Override the source map location on disk with sourceMapPathOverrides

.vscode/launch.js

More info on sourceMapPathOverrides

Breakpoints may still not trigger on initial load.
When you start the debugger which launches Chrome, there is a lag before vscode can attach to Chrome. Any code with breakpoints executed before vscode could attach, will not trigger the breakpoint.

To solve this, either restart the debugger after it has initially loaded (keep Chrome open).

Or you could use

breakOnLoad: true

More info on break on load

Tips

  1. use .scripts command in Debug console to see the loaded scripts. Make sure the paths of the scripts is correct.

2. Open source map file and look how the path to the files have been specified.

3. Use trace: "verbose" to diagnose further.

Frontend Weekly

It's really hard to keep up with all the front-end development news out there. Let us help you. We hand-pick interesting articles related to front-end development. You can also subscribe to our weekly newsletter at http://frontendweekly.co

Ananto Ghosh

Written by

Everyday Coder. @anantoghosh https://mein.in

Frontend Weekly

It's really hard to keep up with all the front-end development news out there. Let us help you. We hand-pick interesting articles related to front-end development. You can also subscribe to our weekly newsletter at http://frontendweekly.co

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade