Title: Circular project references cause tsc --noEmit to silently skip type errors and exit successfully · Issue #65358 · microsoft/TypeScript · GitHub
Open Graph Title: Circular project references cause tsc --noEmit to silently skip type errors and exit successfully · Issue #65358 · microsoft/TypeScript
X Title: Circular project references cause tsc --noEmit to silently skip type errors and exit successfully · Issue #65358 · microsoft/TypeScript
Description: 🔎 Search Terms circular project references self-referencing tsconfig missing semantic diagnostics project references skip type checking typescript circular references TypeScript 7 regression 🕗 Version & Regression Information Reproduces ...
Open Graph Description: 🔎 Search Terms circular project references self-referencing tsconfig missing semantic diagnostics project references skip type checking typescript circular references TypeScript 7 regression 🕗 Vers...
X Description: 🔎 Search Terms circular project references self-referencing tsconfig missing semantic diagnostics project references skip type checking typescript circular references TypeScript 7 regression 🕗 Vers...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/65358
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Circular project references cause tsc --noEmit to silently skip type errors and exit successfully","articleBody":"### 🔎 Search Terms\n\ncircular project references\nself-referencing tsconfig\nmissing semantic diagnostics\nproject references skip type checking\ntypescript circular references\nTypeScript 7 regression\n\n### 🕗 Version & Regression Information\n\nReproduces in TypeScript **7.0.2**.\n\nThis is a regression compared with **6.0.3**, which reports project errors and exits unsuccessfully for the same reproduction. I have not bisected the exact version where this changed.\n\n| Reproduction | TypeScript 6.0.3 | TypeScript 7.0.2 |\n|---|---|---|\n| Self-reference | TS6305 and TS6377; exit 1 | No diagnostics; exit 0 |\n| Two projects referencing each other | TS6305; exit 2 | No diagnostics; exit 0 |\n\nTypeScript 6.0.3 does not report the assignment error while the cycle is present either, but it does report errors rather than silently succeeding.\n\n### ⏯ Playground Link\n\nhttps://github.com/camc314/typescript-circular-references-repro\n\n### 💻 Code\n\n`index.ts`:\n\n```ts\nexport const value: number = \"error\";\n```\n\n`tsconfig.json`:\n\n```json\n{\n \"compilerOptions\": { \"composite\": true },\n \"references\": [{ \"path\": \".\" }]\n}\n```\n\nRun:\n\n```sh\nnpx --yes --package=typescript@7.0.2 tsc --project tsconfig.json --noEmit --pretty false\n```\n\n### 🙁 Actual behavior\n\nTypeScript 7.0.2 produces no diagnostics and exits with code **0**, despite the invalid assignment and circular reference.\n\nRemoving the `references` property and repeating the command produces the expected error and exits with code **1**:\n\n```text\nindex.ts(1,14): error TS2322: Type 'string' is not assignable to type 'number'.\n```\n\nFor comparison, running the original self-referencing project with TypeScript 6.0.3:\n\n```sh\nnpx --yes --package=typescript@6.0.3 tsc --project tsconfig.json --noEmit --pretty false\n```\n\nreports **TS6305** (declaration output has not been built) and **TS6377** (conflicting `.tsbuildinfo` output), and exits with code **1**.\n\nBuild mode correctly detects the cycle in both versions:\n\n```sh\nnpx --yes --package=typescript@7.0.2 tsc --build . --dry --pretty false\n```\n\nThis reports **TS6202** and exits with code **4**.\n\nThe same silent success in TypeScript 7.0.2 also occurs with two projects referencing each other; the self-reference above is the smaller reproduction.\n\n### 🙂 Expected behavior\n\nAlthough the reference graph is invalid, project mode should report the cycle or preserve the applicable source diagnostics, rather than silently returning success.\n\n### Additional information about the issue\n\n**Possible cause**\n\nThe [project reference mapper](https://github.com/microsoft/typescript-go/blob/2bd066d87f5bafd315be9f40889d0a60b9e58e0b/internal/compiler/projectreferenceparser.go#L95) excludes the root configuration using parsed-object identity. Resolving a cycle can reparse the same configuration into a different object, allowing the root project’s own files into the reference mappings.\n","author":{"url":"https://github.com/camc314","@type":"Person","name":"camc314"},"datePublished":"2026-11-06T14:44:24Z","url":"https://github.com/microsoft/TypeScript/issues/65358"}
| 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:325d92e5-b799-92df-ec53-acc4b2c11f19 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BBDE:128099:A462C9:DB7494:6B063EE2 |
| html-safe-nonce | 88e2d40839d7e3cc57032b2e8531e0e3c7547c80fa5de872d0924fe301f88d36 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQkRFOjEyODA5OTpBNDYyQzk6REI3NDk0OjZCMDYzRUUyIiwidmlzaXRvcl9pZCI6IjM0MzMyNDI5MDk0MTAyMTM2MDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | aa3145e5e84bf43df066442685f90b8a7c1ea6415a8914256bcfa52b5e8459f0 |
| hovercard-subject-tag | issue:6244741515 |
| 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/microsoft/TypeScript/65358/issue_layout |
| twitter:image | https://opengraph.githubassets.com/39d20b01b3afeaca4df2149dfbcdaccdff77b4f7cd39276957a744a991ef8b20/microsoft/TypeScript/issues/65358 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/39d20b01b3afeaca4df2149dfbcdaccdff77b4f7cd39276957a744a991ef8b20/microsoft/TypeScript/issues/65358 |
| og:image:alt | 🔎 Search Terms circular project references self-referencing tsconfig missing semantic diagnostics project references skip type checking typescript circular references TypeScript 7 regression 🕗 Vers... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | camc314 |
| hostname | github.com |
| expected-hostname | github.com |
| None | dcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| 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 | 0f38f5735226749ec5e08a8649dce4cb2613d9ad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width