-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugging - Nx to automatically setup debugging configuration in vsCode on newly generated application #5539
Comments
@un33k That sounds like a good workflow indeed. Perhaps you could set this up in a Personally, I've set up some tasks that were parameterized meaning I didn't need to add more config for each new app. @Cammisuli @sandikbarr any ideas here? Could Nx Console help? |
Yes actually. I was looking into providing debugging configs for Nx through Nx Console 😉 |
In the meantime, does anyone have a working |
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
Any updates? |
@ciriousjoker Have you been able to do this successfully? |
tasks.json:
|
@ciriousjoker Thank you for the reply! This does start the app and opens up chrome, but the debugger doesn't attach, and the breakpoints are still unbound :\ Maybe I need to adjust the "webRoot" and "sourceMapPathOverrides" properties? |
@PointSingularity Can't help you sorry.. for me it works perfectly :/ |
@ciriousjoker Hey your code actually works! I was just trying different things, but it turns out that Node version was the problem. Edit: Made it work on node 18.4.0 by adding '--host=127.0.0.1' to the start script.
|
I got debugging working with my node.js service as well, using this launch.json:
|
This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. |
Up |
I upvote this. Joined the monorepo bandwagon, because of the possible benefits it brings regardidng code sharing, but so far I only hit Being unable to debug applications, libs and tests out of the box is a massive pain for any developer and having to deep search google results in search of random solutions, which most of the times don't work due to evolving APIs and versions, is miserable. |
Up :) |
Up from me as well. :) |
Any progress with this? |
any progress ? |
any progress team ? |
@MaxKless is there something we can do with this in Nx Console? 👀 |
Hey everyone :) I'm going to add an Nx Console feature to automatically run a target through the debug terminal which should already be good for many cases. See the tracked issue here nrwl/nx-console#938 You're talking about browser-based applications, though, which need a launch configuration as you describe above. That seems like the job for a generator and not something we should do on the Nx Console side imo. Could you elaborate on the specific issues you're running into trying to use the standard launch configurations specified by the VSCode docs? It seems to me like a bundled Angular + Nx app (for example) with source maps should work just as an Angular CLI app? |
Hey! I'll work on a solution inside Nx Console that should automatically generate source maps when debugging. Ultimately, there are going to be situations where we can't automatically generate source maps for you and you'll have to configure your specific tooling to include source maps in a dev build/serve. |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Description
Debugging is a natural part of any development lifecycle, for both distributed, and/or mono repos, alike. Nx users may benefit tremendously should the app-level generators automatically insert the relevant debugging information into the
.vscode/{tasks,launch}.json
files.Motivation
Creating an Angular, or a NestJS, or any other app is very easy within the Nx workspace, which is meant to streamline and speed up the development process. That is all good till there is a need to attach to an application and step through some complex code, and that is all to avoid excessive use of console.log(s).
At that point, one can assume, setting up the debugging information turns into a monumental task. This is true since Nx moves things around to accommodates all variety of apps so they co-exist.
The same, let's say Angular app in Nx will give users a very hard time, should they try to set up the debugging information. However, if that application was created through NgCli, the setup would be a simple copy & paste of some configuration, right from the vsCode website.
Suggested Implementation
It would be great to automatically populate the
.vscode/launch.json
as well as.vcode/tasks.json
with the necessary information regarding a newly generated application. Nx console already runs in & supports vsCode and the.vscode
directory already exists, so we just need to add those two files.One recommendation would be to add both
launch <app>
andattach <app>
, so users can either have the launcher to start the app, then attach to it, or simply attached to an already laughed application.The text was updated successfully, but these errors were encountered: