Replies: 7 comments
-
I'm currently trying to find out about this as well. Posted a new question before finding this: Did you ever find a solution? |
Beta Was this translation helpful? Give feedback.
-
I'm looking for this as well. |
Beta Was this translation helpful? Give feedback.
-
I am still looking too... |
Beta Was this translation helpful? Give feedback.
-
I am using the recommended NextJS configuration for the vscode debugger and I am having issues with breakpoints working within my packages. Is this related? |
Beta Was this translation helpful? Give feedback.
-
Same problem here as well, since migration to turborepo debugging not working anymore... |
Beta Was this translation helpful? Give feedback.
-
This is a pretty common thing to do in other ecosystems and on larger projects. Sometimes its a monorepo, other times 80 microservice repos on a minikube - the principle is the same - only run what you must in
// .vscode/launch.json
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"cwd": "${workspaceFolder}/apps/web",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
} If you need to run more than 1 debugger, VSCode is capable to run tasks in parallel, although it will get confusing soon. The important part of the launch config above is Bonus points: Since Next.JS is a true full-stack framework, we shouldn't forget CLI script debugging. Turborepo excells at having us decouple administrative scripts from our applications, which we usually place either in
// .vscode/launch.json
{
"type": "node-terminal",
"request": "launch",
"name": "Debug CLI Script",
"command": "npm run cli src/example.ts",
"cwd": "${workspaceFolder}/tooling/scripts",
"skipFiles": ["<node_internals>/**"]
} |
Beta Was this translation helpful? Give feedback.
-
This is my working launch.json file with NestJs ,NextJs setup
|
Beta Was this translation helpful? Give feedback.
-
It can be super helpful to have the debugger configured in VSCode for debugging Next.js applications. The Next.js docs recommend a configuration that can be added to the
.vscode/launch.json
file to make it easy to debug projects with breakpoints.It would be great to be able to debug multiple applications running at the same time (e.g. a docs site and a dashboard using UI components). This would probably be a useful addition to the Turborepo docs, since most users are likely using VSCode. However, it's unclear how/if this works with Turborepo.
I've just started to explore the options here, but haven't really got anywhere. Here's a couple of the questions that have come up so far:
.vscode/launch.json
file configured, or would a single debug configuration at the project root suffice?turbo.json
file for debugging?Has anyone been able to set up a working debugger configuration in their monorepo? I'd love to see how I could get this set up for my own projects and possibly contribute to the docs to help others get started as well.
Beta Was this translation helpful? Give feedback.
All reactions