Title: OOME/Excessively deep type on upgrade from 4.9.4 to 5.x, introduced in 5.0.0-dev.20230203 · Issue #54517 · microsoft/TypeScript · GitHub
Open Graph Title: OOME/Excessively deep type on upgrade from 4.9.4 to 5.x, introduced in 5.0.0-dev.20230203 · Issue #54517 · microsoft/TypeScript
X Title: OOME/Excessively deep type on upgrade from 4.9.4 to 5.x, introduced in 5.0.0-dev.20230203 · Issue #54517 · microsoft/TypeScript
Description: Bug Report 🔎 Search Terms tsc 5.x Out of Memory Heap 🕗 Version & Regression Information This is a crash This changed between versions 5.0.0-dev.20230202 and 5.0.0-dev.20230203 ⏯ Playground Link Unavailable, as I'm trying to compile an in...
Open Graph Description: Bug Report 🔎 Search Terms tsc 5.x Out of Memory Heap 🕗 Version & Regression Information This is a crash This changed between versions 5.0.0-dev.20230202 and 5.0.0-dev.20230203 ⏯ Playground Link Una...
X Description: Bug Report 🔎 Search Terms tsc 5.x Out of Memory Heap 🕗 Version & Regression Information This is a crash This changed between versions 5.0.0-dev.20230202 and 5.0.0-dev.20230203 ⏯ Playground Link...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/54517
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"OOME/Excessively deep type on upgrade from 4.9.4 to 5.x, introduced in 5.0.0-dev.20230203","articleBody":"# Bug Report\r\n\r\n### 🔎 Search Terms\r\n\r\ntsc 5.x Out of Memory Heap\r\n\r\n### 🕗 Version & Regression Information\r\n\r\n- This is a crash\r\n- This changed between versions 5.0.0-dev.20230202 and 5.0.0-dev.20230203\r\n\r\n### ⏯ Playground Link\r\n\r\nUnavailable, as I'm trying to compile an internal codebase, but I can provide access to our github repo if possible.\r\n\r\n### 💻 Code\r\n\r\nThe \"Type is excessively deep\" is being triggered in code that calls this function:\r\n\r\n```\r\nexport type LoadedCollaboration = Loaded\u003cCollaboration, \"parent\">;\r\nexport async function getCollaborationMetadata(c: LoadedCollaboration): Promise\u003cCollaborationMetadata> {\r\n ...\r\n}\r\n```\r\n\r\nWhere `Loaded` is a mapped type (which is available in our open source project):\r\n\r\nhttps://github.com/stephenh/joist-ts/blob/main/packages/orm/src/loadHints.ts#L168\r\n\r\nAnd the `Collaboration` `\"parent\"` key (from our internal project) is a union type with ~20 different types in it:\r\n\r\n```\r\nexport type CollaborationParent =\r\n | ScheduleSubPhase\r\n | Approval\r\n ...15 others...\r\n | ToDo\r\n | SchedulePhase;\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\nIn TS 4.9.4, our codebase compiled fine, in about 50 seconds.\r\n\r\nI tried upgrading to TS 5.1.3, and the compile now OOMEs, and if given enough RAM, eventually after ~10-15 minutes, fails with a \"Type instantiation is excessively deep and possibly infinite\" error.\r\n\r\nBy using the 5.0.0 nightlies published to npm, I was able to bisect that version 5.0.0-dev.20230203 is what introducing the issue, and caused our compile times to jump from ~50 seconds -> 10+ minutes & fail with the type error.\r\n\r\n### 🙂 Expected behavior\r\n\r\n","author":{"url":"https://github.com/stephenh","@type":"Person","name":"stephenh"},"datePublished":"2023-06-04T20:34:40Z","url":"https://github.com/microsoft/TypeScript/issues/54517"}
| 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:023266e9-99d1-431b-d37d-e4b72d6e72d4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 96E4:17FB7:1D327B2:24FE538:6B01974C |
| html-safe-nonce | 78ad4210609c2471b917fb6706a3e70065ef9b4a8d73c9c8559ae0be24f67207 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkU0OjE3RkI3OjFEMzI3QjI6MjRGRTUzODo2QjAxOTc0QyIsInZpc2l0b3JfaWQiOiI1MjIyMDA0NDI5MjE3MTc1MzcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b8cc62eacb6731776a1545237ea2d3dc801e5205a97ed77c3e67eb3622c8b0ab |
| hovercard-subject-tag | issue:1740574472 |
| 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/54517/issue_layout |
| twitter:image | https://opengraph.githubassets.com/85c602e863f3bb5de9c8348b9767134567ead7bd2c117e7e4802ffa4d0b60c93/microsoft/TypeScript/issues/54517 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/85c602e863f3bb5de9c8348b9767134567ead7bd2c117e7e4802ffa4d0b60c93/microsoft/TypeScript/issues/54517 |
| og:image:alt | Bug Report 🔎 Search Terms tsc 5.x Out of Memory Heap 🕗 Version & Regression Information This is a crash This changed between versions 5.0.0-dev.20230202 and 5.0.0-dev.20230203 ⏯ Playground Link Una... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | stephenh |
| 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