question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't debug gatsby develop in v2.22.4

See original GitHub issue

Description

Can’t debug gatsby develop in VS Code.

VS Code v1.45.1 Gatsby v2.22.4

Using launch settings

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Gatsby develop",
      "type": "node",
      "request": "launch",
      "protocol": "inspector",
      "program": "${workspaceRoot}/node_modules/gatsby/dist/bin/gatsby",
      "args": ["develop"],
      "stopOnEntry": false,
      "runtimeArgs": ["--nolazy"],
      "sourceMaps": true,
    }
  ]
}

If I downgrade Gatsby to v2.21.37 it works perfectly.

Withing the debug terminal I can execute .scripts to check which files are loaded and there is no trace of gatsby-node.js. However, gatsby-config.js is and I can set BPs in gatsby-config.js normally.

Steps to reproduce

Clone project at https://github.com/JacoboGallardo/gatsby-debug-issues and follow readme.md instructions.

Expected result

I should be able to hit the BP set in gatsby-node.js.

Actual result

Can’t set any BP in gatsby-node.js.

Environment

System: OS: Windows 10 10.0.18363 CPU: (16) x64 AMD Ryzen 7 2700X Eight-Core Processor
Binaries: Node: 13.14.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD Languages: Python: 3.6.8 - C:\Users\Jacobo\AppData\Local\Programs\Python\Python36\python.EXE Browsers: Edge: 44.18362.449.0 npmPackages: gatsby: ^2.21.37 => 2.21.37 gatsby-image: ^2.4.4 => 2.4.4 gatsby-plugin-manifest: ^2.4.5 => 2.4.5 gatsby-plugin-offline: ^3.2.3 => 3.2.3 gatsby-plugin-react-helmet: ^3.3.1 => 3.3.1 gatsby-plugin-sharp: ^2.6.4 => 2.6.4 gatsby-source-filesystem: ^2.3.4 => 2.3.4 gatsby-transformer-sharp: ^2.5.2 => 2.5.2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
piehcommented, May 28, 2020

Not ideal - but until we get this fixed / provide nicer solution - as workaround, instead of using node --inspect(-brk), “monkey-patch” gatsby/dist/commands/develop.js and change this line: https://github.com/gatsbyjs/gatsby/blob/ad5f9af897257596069f9e8aad307215d98471af/packages/gatsby/src/commands/develop.ts#L71

to this.process = spawn(`node`, [`--inspect-brk`, tmpFileName], {, then use regular gatsby develop and use either auto attach in vscode (or if it can’t find process use “attach to node process”) / regular chrome dev tools way of attaching

0reactions
github-actions[bot]commented, Jul 16, 2020

Hey again!

It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging the Build Process - Gatsby
Gatsby's build and develop steps run as a Node.js application which you can debug using standard tools for Node.js applications.
Read more >
robot - Netlify Support Forums
Build ERROR opt/build/repo/.cache/loader.js: Missing class ... I can not provide you more debug steps because I have no ideas what is going ...
Read more >
yiq - River Thames Conditions - Environment Agency - GOV.UK
Heide rezepa-zabel, Menaldum fitness, Vurpillot automobiles, Build a food web ... Iy2 thai sub, Tonite with hsy season 2 episode 5 full, Tu...
Read more >
Untitled
Android studio ndk debugging, Griffon nivernais for sale, Intrepido albanese trailer, ... Tate engineering halifax, Hashelftextsection can't find build id, ...
Read more >
Changelog | Sanity.io documentation
Fixed an issue where sanity upgrade , sanity versions and sanity debug would ... this plugin requires Gatsby v3 and no longer supports...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found