Compiler SIGABRT: narrowed value does not have the type its narrowing proved (effect Schema/Config-heavy graph)

Đang mở
#4,634 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
compilers

Hướng nghiên cứu

Start with the compiler’s narrowing and type-predicate checking paths, then compare this crash with issue #4171. Reproduce using the repro.ts import of ./src/cli/config.ts from the issue and scriptc build repro.ts -o /tmp/repro --optimization dev. The issue does not identify compiler source files or a focused test; done means the narrowed-value assertion no longer aborts on this repro and a regression test covers the case.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Symptom

Compiling the t3code CLI graph (apps/server/src/binMain.ts or binCli.ts) fails with:

error SC3004: TypeScript API protocol: unexpected end of stream

The SC3004 is a secondary symptom: the compiler process aborts (SIGABRT, exit 134) early — within a minute, at only ~25 MB RSS, so this is not the large-graph memory ceiling. A single-file probe reproduces the abort directly with the real diagnostic:

scriptc: a narrowed value does not have the type its narrowing proved (a type predicate or assertion may be wrong)

Minimal-ish repro

From espetro/t3code branch cursor/scriptc-native-server-7e1f (commit 06d4b24314), in apps/server:

// repro.ts
import * as M from "./src/cli/config.ts";
console.log(typeof M);
scriptc build repro.ts -o /tmp/repro --optimization dev
# exit 134 (SIGABRT): "a narrowed value does not have the type its narrowing proved"

src/cli/config.ts is a narrowing-heavy module: effect/Config, effect/Schema, SchemaTransformation, effect/cli Flag schemas, @t3tools/contracts schemas. The crash fires during checking/lowering before any diagnostic location is printed.

Notes

  • Same class of internal assertion as #4171 (that one reports it via scriptc coverage on @effect/platform-node programs); this repro crashes during a plain scriptc build, on a different (narrowing-heavy) shape, and earlier in the pipeline.
  • Bisecting the t3code graph narrowed the trigger to the config/schema module cluster above; a standalone file importing only that module reproduces.
  • Happy to provide the module sources or a trimmed repro if useful.

Environment

  • scriptc 0.4.17 (also reproduces on the fork synced to upstream main ddbbc1e30b)
  • macOS arm64
Ngôn ngữ chính
TypeScript
Star
6.7k
Fork
229
Merge trung bình
14 giờ 29 phút
Pull request đã merge (30 ngày)
787

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của vercel-labs/scriptc

Tất cả issue của vercel-labs/scriptc

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.