Title: Language server hangs on `initialize` in Dev Containers: debug server options use `--inspect-brk=6009` and the remote extension host runs with `--inspect` · Issue #72113 · angular/angular · GitHub
Open Graph Title: Language server hangs on `initialize` in Dev Containers: debug server options use `--inspect-brk=6009` and the remote extension host runs with `--inspect` · Issue #72113 · angular/angular
X Title: Language server hangs on `initialize` in Dev Containers: debug server options use `--inspect-brk=6009` and the remote extension host runs with `--inspect` · Issue #72113 · angular/angular
Description: Is this a bug report or a feature request? Bug Report Feature Request Please provide the steps to reproduce the issue [Bug Report only] Use VS Code Stable 1.105.0 (commit dcd3ad6e368fbe19d03f37054a40dbaf40d676f4) with the Dev Containers ...
Open Graph Description: Is this a bug report or a feature request? Bug Report Feature Request Please provide the steps to reproduce the issue [Bug Report only] Use VS Code Stable 1.105.0 (commit dcd3ad6e368fbe19d03f37054a...
X Description: Is this a bug report or a feature request? Bug Report Feature Request Please provide the steps to reproduce the issue [Bug Report only] Use VS Code Stable 1.105.0 (commit dcd3ad6e368fbe19d03f37054a...
Opengraph URL: https://github.com/angular/angular/issues/72113
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Language server hangs on `initialize` in Dev Containers: debug server options use `--inspect-brk=6009` and the remote extension host runs with `--inspect`","articleBody":"### Is this a bug report or a feature request?\n\n- [x] Bug Report\n- [ ] Feature Request\n\n### Please provide the steps to reproduce the issue [Bug Report only]\n\n1. Use VS Code **Stable 1.105.0** (commit `dcd3ad6e368fbe19d03f37054a40dbaf40d676f4`) with the Dev Containers extension.\n2. Open an Angular workspace in a Dev Container (image `mcr.microsoft.com/devcontainers/typescript-node:20`, host Windows + WSL2/Docker). Install `Angular.ng-template` **22.2.0** in the container.\n3. Open a `.ts` or `.html` file in an Angular project. This happens every time the container is **opened**, not only when it is first created.\n4. Run `ps -ef --forest` in the container:\n - The remote extension host is running with `--inspect=9220 --experimental-network-inspection`.\n - The Angular server was started with `--nolazy --inspect-brk=6009`.\n\n`server-main.js` and `code-server` are started **without** any `--inspect*` flag (only `--log debug --force-disable-user-env --use-host-proxy ...`). That means the inspect port is added when the extension host is spawned, not by our configuration. We have no `launch.json` entry or setting that enables extension-host debugging.\n\n### Environment\n\n| | |\n|---|---|\n| Extension | `Angular.ng-template` 22.2.0 |\n| VS Code | Stable 1.105.0, commit `dcd3ad6e368fbe19d03f37054a40dbaf40d676f4` |\n| Dev Containers extension | 0.475.0 |\n| Host | Windows + WSL2 (kernel 5.15.146.1-microsoft-standard-WSL2) |\n| Container image | `mcr.microsoft.com/devcontainers/typescript-node:20` |\n| `@angular/core` (workspace) | 20.3.17 |\n| TypeScript | 5.9.3 (workspace version via `--tsdk`, not VS Code's bundled TS) |\n\n### Additional notes\n\n- **Reload Window** or **Developer: Restart Extension Host** usually brings the server back. Oddly, the restarted Angular server still has `--inspect-brk=6009` on its command line. Something seems to attach briefly and resume it, but we haven't confirmed what.\n- We don't know why the remote extension host starts with `--inspect=9220` in our setup. It isn't Insiders, and nothing in `devcontainer.json`, `.vscode/settings.json` or `launch.json` asks for it. If it turns out to be standard Dev Containers / remote behavior, many users could hit this. Either way, the extension shouldn't block in that case.\n- Workaround we use now: a `postAttachCommand` that waits for port 6009 and resumes the server:\n\n ```bash\n for _ in $(seq 150); do\n if (exec 3\u003c>/dev/tcp/127.0.0.1/6009) 2>/dev/null; then\n { sleep 1; echo c; sleep 1; echo .exit; } | node inspect 127.0.0.1:6009 >/dev/null 2>&1\n exit 0\n fi\n sleep 2\n done\n ```\n\n- Possibly related, but with a different symptom (there the server ran and then stalled): #66543.\n- Background: the \"VS Code Insider launches extensions in debug mode\" comment comes from angular/vscode-ng-language-service#1527. This report shows the same debug path also runs on **Stable** in Dev Containers.\n\n\n### Please provide the expected behavior vs the actual behavior you encountered [Bug Report only]\n\n**Expected:** The Angular Language Service starts and answers `initialize`, as it does when the extension host is not in debug mode.\n\n**Actual:** The language server process starts, but it is paused before its first line, waiting for a debugger that never attaches. With `\"angular.trace.server\": \"verbose\"`, the client sends `initialize` and never gets a response. The client stays in the `starting` state indefinitely, so the Angular features never work.\n\n### Root cause\n\n1. `vscode-languageclient` checks whether the **extension host** was started in debug mode (`startedInDebugMode()` looks at `process.execArgv` for `--inspect=`/`--inspect-brk=`/…). If it was, the client launches the server with the `debug` server options instead of the `run` options.\n2. The Angular extension's `debug` options (`client/src/client.ts`, `start()`) are:\n\n ```ts\n debug: {\n // VS Code Insider launches extensions in debug mode by default but users\n // install prod bundle so we have to check whether dev bundle exists.\n module: fs.existsSync(devBundle) ? devBundle : prodBundle,\n transport: lsp.TransportKind.ipc,\n options: {\n execArgv: [\n '--nolazy',\n // If debugging port is changed, update .vscode/launch.json as well\n '--inspect-brk=6009',\n ],\n env: { NG_DEBUG: true },\n },\n args,\n },\n ```\n\n The comment shows this path is already expected to run for end users with the production bundle. In that case `--inspect-brk` blocks the server until a debugger attaches.\n3. The other language servers started by the same extension host use non-blocking `--inspect=\u003cport>` in their debug options and start normally: built-in HTML (`--inspect=8439`), JSON (`--inspect=6418`), Markdown (`--inspect=7011`), and ESLint (`--inspect=6011`).\n\n### Proof\n\nAttaching to the paused process and continuing it fixes the problem:\n\n```\n$ node inspect 127.0.0.1:6009\nconnecting to 127.0.0.1:6009 ... ok\nBreak on start in /home/node/.vscode-server/extensions/angular.ng-template-22.2.0/server/index.js:2\n 1 \"use strict\";\n> 2 var __getOwnPropNames = Object.getOwnPropertyNames;\n 3 var __commonJS = (cb, mod) => function __require() {\ndebug> c\n```\n\nAfter `c`, the server answers `initialize` and the Angular Language Service works normally.\n\n### Please provide a screenshot if possible [Bug Report only]\n\nOutput of the \"Angular Language Service\" extension after opening the container.\n\u003cimg width=\"903\" height=\"442\" alt=\"image\" src=\"https://github.com/user-attachments/assets/bc175ac9-eed8-4fc2-ae46-7cb12cb83238\" />\n\u003cbr/>\nError when attempting to restart the Angular Language server.\n\u003cimg width=\"462\" height=\"180\" alt=\"image\" src=\"https://github.com/user-attachments/assets/d6497d25-3a0b-4c31-a569-524061909798\" />\n\n### Please provide the exception or error you saw [Bug Report only]\n\n```true\n# Process tree on a failed open (ps -ef --forest, trimmed)\nnode 568 338 .../node --dns-result-order=ipv4first --inspect=9220 --experimental-network-inspection .../out/bootstrap-fork --type=extensionHost --transformURIs --useHostProxy=true\nnode 609 568 .../node --nolazy --inspect=8439 .../html-language-features/server/dist/node/htmlServerMain --node-ipc --clientProcessId=568\nnode 671 568 .../node --nolazy --inspect-brk=6009 /home/node/.vscode-server/extensions/angular.ng-template-22.2.0/server --logToConsole --logFile .../nglangsvc.log --logVerbosity verbose --ngProbeLocations ... --angularCoreVersion 20.3.17 --tsdk /workspaces/\u003cworkspace>/node_modules/typescript/lib --tsProbeLocations ... --useClientSideFileWatcher --node-ipc --clientProcessId=568\nnode 716 568 .../node --nolazy --inspect=6275 .../json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=568\nnode 734 568 .../node --nolazy --inspect=6011 /home/node/.vscode-server/extensions/dbaeumer.vscode-eslint-3.0.34/server/out/eslintServer.js --node-ipc --clientProcessId=568\n\n# lsof -i :6009 (listening, no debugger attached; `ss -tnp` shows no established connection)\nCOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME\nMainThrea 671 node 26u IPv4 5087030 0t0 TCP localhost:6009 (LISTEN)\n\n# Trying \"Angular: Restart Angular Language server\" while it is stuck\nClient is not running and can't be stopped. It's current state is: starting\n\n\nThe last error is a secondary effect of stopping a client that is still `starting` (see microsoft/vscode-languageserver-node#1307). It is not the cause.\n```\n\n### Description [Feature Request only]\n\n_No response_\n\n### Proposed solution [Feature Request only]\n\n_No response_\n\n### Alternatives considered [Feature Request only]\n\n_No response_","author":{"url":"https://github.com/Jorrex","@type":"Person","name":"Jorrex"},"datePublished":"2026-11-19T12:29:35Z","url":"https://github.com/angular/angular/issues/72113"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9577fda6-46aa-a658-5e9a-28af8ccdc5d6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A6C6:2463BD:34D9B1C:43848DA:6B01D64D |
| html-safe-nonce | 3238aec6fa13cd5ece945951dbf0fde3038f9b0fbfb720f73830e7591af4901d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNkM2OjI0NjNCRDozNEQ5QjFDOjQzODQ4REE6NkIwMUQ2NEQiLCJ2aXNpdG9yX2lkIjoiODI5MjYyOTkzMDk5OTY2NjI1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ffa04f9fd47d5e5a735b633ff3ae58733ed8356d4f777e754757b66d6519a1b8 |
| hovercard-subject-tag | issue:6489606035 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/72113/issue_layout |
| twitter:image | https://opengraph.githubassets.com/45b3520cbda2bc586cc669bf2b74a81b7ea6bc61173dbf83ebb10bb18bd6212f/angular/angular/issues/72113 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/45b3520cbda2bc586cc669bf2b74a81b7ea6bc61173dbf83ebb10bb18bd6212f/angular/angular/issues/72113 |
| og:image:alt | Is this a bug report or a feature request? Bug Report Feature Request Please provide the steps to reproduce the issue [Bug Report only] Use VS Code Stable 1.105.0 (commit dcd3ad6e368fbe19d03f37054a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Jorrex |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width