Hi,
I tried to explore some options for debugging with redwood in VSCode but without success. Someone could give me a hint?
Thank you very much in advance,
Bests,
Hi,
I tried to explore some options for debugging with redwood in VSCode but without success. Someone could give me a hint?
Thank you very much in advance,
Bests,
Hi @pnhoang! Thanks for checking in here. This isnāt quite what youāre looking for, but hereās a brand new VS Code extension for Redwood that does offer some debugging features:
https://marketplace.visualstudio.com/items?itemName=decoupled.studio
Hi @thedavid,
Thanks for your response. Iāll check it out.
Is there an option like redwood dev --inspect
supported?
Bests,
HI @pnhoang - Iāve had moderate success using the node.js debug terminal in vscode to run yarn rw dev.
You could also try setting up a launch.json file, I know the community would appreciate your contribution!
Not at this time, unfortunately. The closest we have is a CLI command for overall project structure inspection. This will tell you if youāre missing files, have incorrect Redwood syntax/conventions, etc.
yarn rw diagnostics
Other than that, as @danny mentioned most people rely on built in VS Code debug.
React/GraphQL/JS debugging is painful, isnāt it? Weāre hoping to increasingly make it less painful but recognize we arenāt there yet.
yarn rw dev
runs two processes:
You can run inspect by doing the following in your projectās directory
cd api
yarn dev-server --inspect
I think we could definitely add this as an option that gets forwarded to the api-dev-server, Iāve added an issue over here: Add option --inspect dev-server Ā· Issue #936 Ā· redwoodjs/redwood Ā· GitHub
You could also try setting up a launch.json
Hereās what worked for me:
{
"version": "0.2.0",
"configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Launch API",
"skipFiles": [
"<node_internals>/**"
],
"cwd": "${workspaceFolder}/api",
"envFile": "${workspaceFolder}/.env.defaults",
"program": "${workspaceFolder}/node_modules/.bin/dev-server"
}
]
}
I just created a pull-request adding a launch.json file