Nx should help provide some debug configs or a guide for VSCode #23270
Playjasb2
started this conversation in
Feature Requests
Replies: 3 comments
-
To add to this, i'm not even sure you can debug a nestjs app. when i serve my app, it gets built in production mode...
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I've converted this to a discussion to continue discussing what kind of particular configs people would like to see added. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Nx should provide some debug configs for VSCode. More specifically, when we have apps in this monorepo like NestJS, Nx should provide us a launch.json file that would set up the debugger in VSCode such that we can easily attach to our app and be able to debug it step-by-step, without getting any issues with breakpoint bindings.
Motivation
I tried to debug my NestJS app in my Nx monorepo. I searched online to find the right launch.json config needed for my setup. Some provided a config that would launch the app, while others provided a config that would attach to an existing process, which is what I want.
However, when I try to run the debugger with my script, it worked. But when I try to set the breakpoints, it says it won't bind. I am using the default Nx setup with NestJS. Some people online are suggesting that the issue may be with the source maps. Again I'm not sure.
I am using a setup that involves all my apps being defined in the apps/ directory, and they would bootstrap source code from all my libraries defined in my libs/ directory, that exists at the same level as apps/.
Furthermore, when I try to set this up to debug the app on a Docker container, and have that container expose the debug port, I get issues where I can't connect to it.
Answers online are not very clear here in this regard, and it's taking me hours to try to find some solution. I asked on Discord, but I'm not getting any answers there.
I want to use Nx as my monorepo framework, but I don't want to lose debug capabilities.
Suggested Implementation
A video or a written guide that explains how to go about debugging apps (including NestJS) in an Nx monorepo in VSCode.
Maybe have Nx create the launch.json for us. Granted, this would be specific to VSCode.
Beta Was this translation helpful? Give feedback.
All reactions