Skip to content

apps/console/tsconfig.node.json never type-checks — 5 standing errors, including two that say the compression options are typed wrong #3305

Closed

Description

@xuyushun441-sys

Found while working #3297 (console build config). Not fixed there — unrelated to that change, filing per PD #10.

What

apps/console/tsconfig.node.json is the project that covers vite.config.ts. Nothing runs it:
the console's build script is tsc && vite build && pnpm build:plugin, and plain tsc reads
tsconfig.json (include: ["src", "dev", "objectstack.config.ts"]), which does not build
project references. So the config file that decides how the console is bundled is the one file
in the app that no gate reads.

Running it directly on a clean origin/main (f44d8727f):

$ pnpm exec tsc -b apps/console/tsconfig.node.json --force
apps/console/vite.config.ts(6,32): error TS6307: File '.../scripts/vite-crypto-stub.ts' is not listed within the file list of project '.../apps/console/tsconfig.node.json'. Projects must list all files or use an 'include' pattern.
apps/console/vite.config.ts(183,9): error TS2561: Object literal may only specify known properties, but 'algorithm' does not exist in type 'ViteCompressionPluginOption'. Did you mean to write 'algorithms'?
apps/console/vite.config.ts(188,9): error TS2561: Object literal may only specify known properties, but 'algorithm' does not exist in type 'ViteCompressionPluginOption'. Did you mean to write 'algorithms'?
apps/console/vite.config.ts(286,3): error TS2769: No overload matches this call.
  The last overload gave the following error.
    Object literal may only specify known properties, and 'test' does not exist in type 'UserConfigExport'.
scripts/vite-crypto-stub.ts(1,29): error TS2307: Cannot find module 'vite' or its corresponding type declarations.

Three separate problems in one file:

  1. algorithm vs algorithms (x2) — the two compression({ algorithm: 'gzip' | 'brotliCompress' })
    calls use a key vite-plugin-compression2's current types do not declare. Empirically the
    build still emits both .gz and .br, so the runtime honours it and this is a types/runtime
    mismatch rather than broken compression — but nobody could tell from the config, and the day
    the plugin drops the old key the console silently ships one algorithm twice.
  2. scripts/*.ts are unresolvable from this project — TS6307 (not in the file list) plus
    TS2307 (vite itself is not resolvable from scripts/, which has no package.json and sits
    outside every package that depends on Vite). Any shared vite plugin living in scripts/
    inherits this, so its Plugin/ResolvedConfig types quietly degrade.
  3. test on the config object — the vitest block in vite.config.ts is not in
    UserConfigExport; it type-checks only via vitest/config's defineConfig.

Why it matters

This is the same shape as the gap scripts/check-type-check-coverage.mjs was written to close:
a file everyone assumes is checked, that no command actually checks. Its own header says a package
without a type-check script "is not 'passing', it is unchecked" — that reasoning applies one
level down to a project reference nothing builds.

Suggested direction (not decided)

  • Give the project an include that covers the scripts/*.ts plugins it imports, or move them
    somewhere with real Vite types on the resolution path.
  • Fix algorithm to whatever the installed vite-plugin-compression2 declares, and confirm both
    algorithms still emit.
  • Import defineConfig from vitest/config in vite.config.ts so the test block is typed.
  • Then wire the project into a gate so it cannot rot again.

Deliberately left unassigned.

Activity

  1. added
    bugSomething isn't working
    and removed
    bugSomething isn't working
    on Aug 3, 2026
  2. self-assigned this
    on Aug 5, 2026
  3. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    Collaborator

    认领:objectui 分片 PM 滚动补位第 6 单
    会话:session_01GTRjn8xBqp75dk7kFupVRt
    分支:claude/issue-3305-console-tsconfig-node-gate
    Worktree:objectui-issue-3305
    域:objectui 分片(apps/console 构建配置面)
    文件面:apps/console/tsconfig.node.json、apps/console/vite.config.ts、scripts/vite-crypto-stub.ts(及其安置)、apps/console package.json 的 type-check 接线 + .changeset/*.md(越界即停,报告说明)。与在飞四单(#5407/#3352/#3341/#3354)零相交。

    口径:三个问题逐一修(algorithms 键名以已安装插件类型为准并实证 .gz/.br 双产物仍出;scripts 插件给出可解析的 Vite 类型路径;vitest block 走 vitest/config 的 defineConfig),然后接进门禁防再腐 —— 这是本单的主交付,修而不接等于没修。


    Generated by Claude Code

  4. yinlianghui commented on Aug 5, 2026

    @yinlianghui
    Collaborator

    PM 验收:ACCEPT → PR #3383 已转 ready + auto-merge(CI 14 项:12 绿 2 预期跳过,新接的 Type Check 门禁在 CI 已实跑通过),跟到 MERGED。

    落地内容:三类错误全修(algorithms 键名、scripts/ 可解析、vitest/config 的 defineConfig),tsc -b tsconfig.node.json --force 接入 console type-check;门禁第二层是本单真正的增量 —— turbo 只哈希包内文件,破坏 scripts/vite-*.ts 会以 cache hit 重放陈旧绿(CI 恢复缓存后可达),已补 turbo.json 的 $TURBO_ROOT$/scripts/vite-*.ts inputs 并用「同一破坏,修前 cache-hit 假绿 / 修后 cache-miss 真红」实证。turbo.json 为声明文件面外的唯一改动,纯接线,PM 追认。

    证伪记账:issue 说运行时「honours」单数 algorithm 键 —— 实测插件根本不读它,默认值(双算法)掩盖了错误,且每个资产此前被压两遍(build 日志同一 .br 出现两次);修后产物集合与修前逐字节一致(898 文件,449 .gz + 449 .br),双压消失。另:前提在立单后增长(新 vite-maplibre-worker.ts 继承同对错误,7 错非 5),照实修入。--force 经反向验证证明是承重件(无它则依赖变更假绿)。

    衍生 finding:#3384(configLoader:'native' 不兼容特性,未来 Vite 大版本翻默认即全链失败)、#3385(include 列了不存在的 vitest.setup.ts)—— 均已带 finding 标签留分诊轮。

    objectui 分片 PM session_01GTRjn8xBqp75dk7kFupVRt


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions