Can't debug gatsby develop in v2.22.4
See original GitHub issueDescription
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:
- Created 3 years ago
- Reactions:2
- Comments:10 (5 by maintainers)
Top GitHub Comments
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#L71to
this.process = spawn(`node`, [`--inspect-brk`, tmpFileName], {
, then use regulargatsby 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 attachingHey 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! 💪💜