OOME/Excessively deep type on upgrade from 4.9.4 to 5.x, introduced in 5.0.0-dev.20230203
@jakebailey đang làm issue này rồi.
Từ ngày 20/6/2023.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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 internal codebase, but I can provide access to our github repo if possible.
💻 Code
The "Type is excessively deep" is being triggered in code that calls this function:
export type LoadedCollaboration = Loaded<Collaboration, "parent">;
export async function getCollaborationMetadata(c: LoadedCollaboration): Promise<CollaborationMetadata> {
...
}
Where Loaded is a mapped type (which is available in our open source project):
https://github.com/stephenh/joist-ts/blob/main/packages/orm/src/loadHints.ts#L168
And the Collaboration "parent" key (from our internal project) is a union type with ~20 different types in it:
export type CollaborationParent =
| ScheduleSubPhase
| Approval
...15 others...
| ToDo
| SchedulePhase;
🙁 Actual behavior
In TS 4.9.4, our codebase compiled fine, in about 50 seconds.
I 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.
By 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.
🙂 Expected behavior
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.4k
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 106
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/TypeScript
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
microsoft/TypeScript#64322 · 2 bình luận · 1 reaction · 2 người được giao ·
-
Possible Improvement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
microsoft/TypeScript#64278 · 1 bình luận · 1 reaction ·
-
Docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
microsoft/TypeScript#64118 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
microsoft/TypeScript#64094 ·
-
Docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/TypeScript#63959 · 5 bình luận ·
Tất cả issue của microsoft/TypeScript
Issue tương tự
-
Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
OpenNSW/nsw-srilanka#497 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
milvus-io/birdwatcher#545 ·
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
kubernetes-sigs/prow#953 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
JuliusBrussee/caveman#1102 · 1 bình luận ·