Gatsbyjs breakpoints not hit in any custom script during debugging

Viewed 313

I'm trying to debug my gatsbyjs code in visual studio code. I followed the docs and and tried slightly different approaches like https://github.com/Microsoft/vscode-recipes/tree/master/Gatsby-js.

I can start debugging and the site builds, but my none of my breakpoints in any of my files get hit, they get instead show up as unverified. When pausing the debug process though, I (somewhat) randomly end up in the source code of any of the external modules, and there I am able to place breakpoints that do stop...

Is there maybe some setup step or something I'm missing to make it work on page components and other react components? Thanks for any help!

1 Answers

Adding a

debugger;

statement in the JS react page components definitely works for me. But be reminded that in development mode (gatsby develop), some breakpoints will get hit on startup, while others are only hit on page request. This of course depends on where you place your breakpoints.

Related