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

オープン
#4,634 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
compilers

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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
主要言語
TypeScript
スター
6.7k
フォーク
229
平均マージ
14時間 29分
マージ済み PR(30日)
787

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vercel-labs/scriptc のほかの issue

vercel-labs/scriptc の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。