Title: `RangeError: Maximum call stack size exceeded` Regression in #52392 · Issue #60927 · microsoft/TypeScript · GitHub
Open Graph Title: `RangeError: Maximum call stack size exceeded` Regression in #52392 · Issue #60927 · microsoft/TypeScript
X Title: `RangeError: Maximum call stack size exceeded` Regression in #52392 · Issue #60927 · microsoft/TypeScript
Description: 🔎 Search Terms RangeError: Maximum call stack size exceeded, #52392 🕗 Version & Regression Information This changed in commit or PR #52392 ⏯ Playground Link https://www.typescriptlang.org/play/?#code/KYDwDg9gTgLgBAbwL4G4BQaAmwDGAbAQymDgI...
Open Graph Description: 🔎 Search Terms RangeError: Maximum call stack size exceeded, #52392 🕗 Version & Regression Information This changed in commit or PR #52392 ⏯ Playground Link https://www.typescriptlang.org/play/?#co...
X Description: 🔎 Search Terms RangeError: Maximum call stack size exceeded, #52392 🕗 Version & Regression Information This changed in commit or PR #52392 ⏯ Playground Link https://www.typescriptlang.org/play/...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/60927
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`RangeError: Maximum call stack size exceeded` Regression in #52392","articleBody":"### 🔎 Search Terms\n\nRangeError: Maximum call stack size exceeded, #52392\n\n### 🕗 Version & Regression Information\n\n- This changed in commit or PR #52392\n\n\n### ⏯ Playground Link\n\nhttps://www.typescriptlang.org/play/?#code/KYDwDg9gTgLgBAbwL4G4BQaAmwDGAbAQymDgICMBnGKAnefAiiuAFQE8xgARAmAgWQjY8AHgAKRYADsYAPkRo4cMJJkAuOBOIz0i5cRXEuwKAEsAbsEw8+ACj1KYAC1MUNz13FAxpmZgmVVGA1TKQAzEzgAfTgkOAB+OClgSyg4DWTUvQBKDXMIU0x0JAxsBmI4BiY4ACFGYABJHwBbLxAfKT84LggcAFdm6RgRAik2eQQ9QyGNOopGloA6LSHirFxCCqkCQYoVHBI5heBWyccOEhWZOABeOBgLiDC4AEE6aDEWACUAJmA19blEgAczwEDIBDwCiU212+xIYQgfU6UDY0KUbUgsDgpmaWPgUQAqlI+vNMLdavUmid0EoSiVAZsSFVmNTWt5fMwev1BtdkKUNpJKoRqgAxCB4bBQT6-EhnOAgdyPZ5vGAfb5-AFlJnCxjMVXq2XothKzhPODiyUmGWavQALw07E4NgEQmAogeZuebNkAM9JGMwDAWhgpkhIhYbQ6XXBACtcHIKfKANoAaRxUjgAGtgGxzSwALrxDRRQPBoih8MsNMF31oVBof3RMshsOiFjyO6RjmdZhxhMJbrAIOtqvyR26bVClndXoDIYAZScw5gADUfiJufOZAAaOAAYQg4VMwL6NFDR6jnLg-boFNG43ROCPVCgfXeUHsGJvYAvUjcQ4jhWbYiIex6nuephHvIABk6Lfpgc68sEs48qsDixDkWqChUz7-vAiJWlAprAOalpSja-xoMkADuqHbjAS4ruutgBIhaHqHAhFSrE2ToEAA\n\n### 💻 Code\n\n```ts\nexport {};\n\ndeclare abstract class TypeDataModel\u003cParent> {\n parent: Parent;\n\n prepareDerivedData(\n this: this extends { parent: infer _ } ? never : never\n ): void;\n}\n\ndeclare class BaseItem extends Document\u003cany> {\n parent: BaseItem.Parent;\n}\ndeclare namespace BaseItem {\n type Parent = typeof ActorPTR2e;\n}\n\ndeclare global {\n namespace foundry {\n export import _Unused = BaseItem;\n }\n}\n\ndeclare class Item extends Document {}\n\ndeclare class FolderPTR2e {\n x: typeof ActorPTR2e;\n}\n\ndeclare class ActorPTR2e {\n y: typeof FolderPTR2e;\n z: TypeDataModel\u003ctypeof Item>;\n}\n\ntype DeepPartial\u003cT extends object> = {\n [K in keyof T]?: _DeepPartial\u003cT[K]>;\n};\ntype _DeepPartial\u003cT> = T extends object ? DeepPartial\u003cT> : T;\n\ndeclare class DocumentSheetV2\u003cDocument, Configuration extends object = any> {\n constructor(\n options: DeepPartial\u003cConfiguration> & {\n document: Document;\n }\n );\n}\n\ndeclare const folder: typeof FolderPTR2e;\nnew DocumentSheetV2({ document: folder });\n```\n\n\n### 🙁 Actual behavior\n\nThe compiler crashes with `RangeError: Maximum call stack size exceeded`.\n\n```\nRangeError: Maximum call stack size exceeded\n at structuredTypeRelatedToWorker (node_modules/typescript/lib/_tsc.js:64885:43)\n at structuredTypeRelatedTo (node_modules/typescript/lib/_tsc.js:64817:21)\n at recursiveTypeRelatedTo (node_modules/typescript/lib/_tsc.js:64768:19)\n at isRelatedTo (node_modules/typescript/lib/_tsc.js:64186:122)\n at isPropertySymbolTypeRelated (node_modules/typescript/lib/_tsc.js:65563:14)\n at propertyRelatedTo (node_modules/typescript/lib/_tsc.js:65603:23)\n at propertiesRelatedTo (node_modules/typescript/lib/_tsc.js:65814:29)\n at structuredTypeRelatedToWorker (node_modules/typescript/lib/_tsc.js:65361:21)\n at structuredTypeRelatedTo (node_modules/typescript/lib/_tsc.js:64817:21)\n at recursiveTypeRelatedTo (node_modules/typescript/lib/_tsc.js:64768:19)\n```\n(this is on 5.8.0-dev.20250106 but the same error appears on 5.7.2 and several other versions I tested as well as all the ones I bisected)\n\n### 🙂 Expected behavior\n\nRegular errors. This file has a few but in my original repo there were less, possibly none?\n\nThe editor doesn't crash and reports these errors:\n```\nType instantiation is excessively deep and possibly infinite.\nExpression produces a union type that is too complex to represent.\n```\nOn `DocumentSheetV2`. I find the second one odd because there's not a single union in the program.\n\nThere's also the error:\n```\nNo base constructor has the specified number of type arguments.\n```\n\nOn `Document\u003cany>`, because `Document` doesn't take type arguments. In my original repo I wasn't passing a generic to a class without one but this was the easiest way to reliably reproduce it. I can get it to work _without_ the `\u003cany>` but it was simply less reliable while I was reducing so I left it in.\n\n### Additional information about the issue\n\n_No response_","author":{"url":"https://github.com/LukeAbby","@type":"Person","name":"LukeAbby"},"datePublished":"2025-01-07T09:57:24Z","url":"https://github.com/microsoft/TypeScript/issues/60927"}
| 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:8ca78825-7a1d-2881-b5c0-797cf7a7d341 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B02A:6DC60:1E4981D:2635962:6B0197B5 |
| html-safe-nonce | bc2b86cf7eb3bd189c61af861d080c2412dbbbbfc80f179b3e2484323d43b56e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDJBOjZEQzYwOjFFNDk4MUQ6MjYzNTk2Mjo2QjAxOTdCNSIsInZpc2l0b3JfaWQiOiIzMDQzMTMxNjY1NTY5Mzg4NDY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 65655fde886c918ef3224bfcb1188982b70a0ad1e809afe24480f2a8bb1f1aa7 |
| hovercard-subject-tag | issue:2772401189 |
| 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/60927/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8fd86715de329db6f3f6afad9759ee1dbb8bc96cbd571675469fe45bf76d35db/microsoft/TypeScript/issues/60927 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8fd86715de329db6f3f6afad9759ee1dbb8bc96cbd571675469fe45bf76d35db/microsoft/TypeScript/issues/60927 |
| og:image:alt | 🔎 Search Terms RangeError: Maximum call stack size exceeded, #52392 🕗 Version & Regression Information This changed in commit or PR #52392 ⏯ Playground Link https://www.typescriptlang.org/play/?#co... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | LukeAbby |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width