Title: TS5115 in published Zod 4.5–4.6 types after #64372 · Issue #64605 · microsoft/TypeScript · GitHub
Open Graph Title: TS5115 in published Zod 4.5–4.6 types after #64372 · Issue #64605 · microsoft/TypeScript
X Title: TS5115 in published Zod 4.5–4.6 types after #64372 · Issue #64605 · microsoft/TypeScript
Description: After #64372 Zod 4.5.0-4.6.5 break in TS 7.1 nightlies. I'm merging a fix Zod side, but the affected versions account for ~62M weekly downloads. In the long term I think it's a good price to pay for the improved recursive inference stuff...
Open Graph Description: After #64372 Zod 4.5.0-4.6.5 break in TS 7.1 nightlies. I'm merging a fix Zod side, but the affected versions account for ~62M weekly downloads. In the long term I think it's a good price to pay fo...
X Description: After #64372 Zod 4.5.0-4.6.5 break in TS 7.1 nightlies. I'm merging a fix Zod side, but the affected versions account for ~62M weekly downloads. In the long term I think it's a good price t...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/64605
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TS5115 in published Zod 4.5–4.6 types after #64372","articleBody":"After https://github.com/microsoft/TypeScript/pull/64372 Zod 4.5.0-4.6.5 break in TS 7.1 nightlies. I'm merging a fix Zod side, but the affected versions account for ~62M weekly downloads. In the long term I think it's a good price to pay for the improved recursive inference stuff, and not that many people use `z.json()`, but just wanted to make sure all options were explored for avoiding this break (as long is it doesn't involve dropping any functionality from #64372 et al). 👍\n\n---\n\n### 🔎 Search Terms\n\nTS5115, \"appear infinitely circular\", base type arguments, zod, 64372\n\n### 🕗 Version & Regression Information\n\n- Introduced by #64372, first in `7.1.0-dev.20260929.1`. `7.0.2` and the commit before #64372 are fine. Still present in `7.1.0-dev.20261002.1`.\n\n### ⏯ Playground Link\n\n_No response_\n\n### 💻 Code\n\n```ts\ninterface Internals\u003cI = unknown> { input: I }\ninterface Schema { _zod: Internals }\ntype RecordInput\u003cV extends Schema> = V extends unknown ? Record\u003cstring, V[\"_zod\"][\"input\"]> : never;\ninterface RecordSchema\u003cV extends Schema> extends Schema { _zod: Internals\u003cRecordInput\u003cV>> }\ninterface UnionInternals\u003cT extends readonly Schema[]> extends Internals\u003cT[number][\"_zod\"][\"input\"]> {}\ninterface UnionSchema\u003cT extends readonly Schema[]> extends Schema { _zod: UnionInternals\u003cT> }\ntype JsonValue = { [k: string]: JsonValue };\ntype _Json = UnionSchema\u003c[RecordSchema\u003cJson>]>;\ntype _JsonInternals = _Json[\"_zod\"];\ninterface JsonInternals extends _JsonInternals { input: JsonValue }\ninterface Json extends _Json { _zod: JsonInternals }\n```\n\nWith the published package (`zod@4.6.5`, `skipLibCheck: true`):\n\n```ts\nimport * as z from \"zod\";\nexport const A = z.array(z.json()); // TS5115\n```\n\n### 🙁 Actual behavior\n\nTS5115 \"Instantiations of the following types appear infinitely circular\" on `RecordSchema\u003cJson>`. The same shape is Zod's `z.json()` type, so Zod 4.5.0 through 4.6.5 fail on 7.1:\n\n- with `skipLibCheck: false`, every project that imports Zod gets TS5115 from Zod's own declarations\n- with `skipLibCheck: true`, `z.array(z.json())`, `z.record(z.string(), z.json())` or `.parse()` on an object holding `z.json()` reports it in user code, and the record's input type becomes `Record\u003cstring, any>`\n\n### 🙂 Expected behavior\n\nNo error, as in 7.0.2.\n\n### Additional information about the issue\n\nThose versions get about 62M of Zod's 365M weekly npm downloads. The member-declaration fix from https://github.com/microsoft/TypeScript/pull/64372#issuecomment-5804602336 is merged in colinhacks/zod#6645 and goes out in the next Zod release, but projects that stay on 4.5.0–4.6.5 will still break when they move to 7.1.\n","author":{"url":"https://github.com/colinhacks","@type":"Person","name":"colinhacks"},"datePublished":"2026-10-02T18:09:47Z","url":"https://github.com/microsoft/TypeScript/issues/64605"}
| 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:87e54e1d-1e4a-f9b4-22b5-9f3bb804815f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B66C:3A4875:B11B97:ECFFD4:6B00F219 |
| html-safe-nonce | 84f8cc166a4ea11c0bdc54340151e802daeb78b4845f4cf63710f97337a3a361 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjZDOjNBNDg3NTpCMTFCOTc6RUNGRkQ0OjZCMDBGMjE5IiwidmlzaXRvcl9pZCI6IjcyNjQ1MTc1NDc0OTQ1MzU3MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | e1c26b789c949e489fa3fc16a4ea83c2ebc319a766f2b6143a332b832f1f76b8 |
| hovercard-subject-tag | issue:5681437569 |
| 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/64605/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b0c441a2bea5149131459db7e5fb9ba49ec6e2db96130b2e0d2100140b3f3bbe/microsoft/TypeScript/issues/64605 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b0c441a2bea5149131459db7e5fb9ba49ec6e2db96130b2e0d2100140b3f3bbe/microsoft/TypeScript/issues/64605 |
| og:image:alt | After #64372 Zod 4.5.0-4.6.5 break in TS 7.1 nightlies. I'm merging a fix Zod side, but the affected versions account for ~62M weekly downloads. In the long term I think it's a good price to pay fo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | colinhacks |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width