GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `--incremental` retains stale diagnostics when augmenting a re-exported interface · Issue #64386 · microsoft/TypeScript

--incremental retains stale diagnostics when augmenting a re-exported interface #64386

New issue
Copy link
New issue
Copy link
Open
Open
--incremental retains stale diagnostics when augmenting a re-exported interface#64386
Copy link
Assignees
johnfav03
Labels
Needs InvestigationThis issue needs a team member to investigate its status.
Milestone
Backlog

Description

@infomiho
Mihovil Ilakovac (infomiho)
opened on Sep 22, 2026
Issue body actions

🔎 Search Terms

incremental stale diagnostics module augmentation re-export interface tsbuildinfo

🕗 Version & Regression Information

Reproduces on TypeScript 6.0.3, 7.0.2, and 7.1.0-dev.20260922.1 (the next version when tested).

Tested on macOS arm64 with Node 24.14.1 and npm 11.18.0. I reviewed the FAQ and searched existing augmentation and incremental-build reports.

⏯ Playground Link

https://github.com/infomiho/typescript-incremental-augmentation-repro

💻 Code

// src/registry.ts
export interface Registry {}

// src/index.ts
export type { Registry } from "./registry.js"

// src/augment.ts
import "./index.js"

declare module "./index.js" {
  interface Registry {
    value: number
  }
}

// src/consumer.ts
import type { Registry } from "./registry.js"

const value: Registry["value"] = "hello"

package.json:

{
  "private": true,
  "type": "module",
  "scripts": {
    "check": "tsc"
  },
  "devDependencies": {
    "typescript": "7.0.2"
  }
}

tsconfig.json:

{
  "compilerOptions": {
    "incremental": true,
    "noEmit": true,
    "tsBuildInfoFile": ".cache/tsconfig.tsbuildinfo"
  },
  "include": ["src"]
}
  1. Run npm run check. The initial TS2322 error is expected.
  2. Change only value: number to value: string in src/augment.ts.
  3. Run npm run check again, retaining the build cache.
  4. Delete .cache/tsconfig.tsbuildinfo and run npm run check again, without changing any source.

🙁 Actual behavior

Step 3 still reports this error in src/consumer.ts:

error TS2322: Type 'string' is not assignable to type 'number'.

Step 4 succeeds. Incremental and clean builds disagree on identical source files.

🙂 Expected behavior

Step 3 should succeed, matching the clean build. The augmentation now declares value: string.

Additional information about the issue

Changing both ./index.js paths in src/augment.ts to ./registry.js avoids the stale error. Defining Registry in src/index.ts and re-exporting it from src/registry.ts also avoids it. Both controls were verified on all three compiler versions above.

Related: #44094, fixed by #45156, concerns missed augmentation updates during incremental compilation. #63960 also involves augmentation through a type-only re-export, but reports a file-order issue.

Activity

  1. Ryan Cavanaugh (RyanCavanaugh)
    added
    Needs InvestigationThis issue needs a team member to investigate its status.
    on Sep 22, 2026
  2. Ryan Cavanaugh (RyanCavanaugh)
    assigned
    John Favret (johnfav03)
    on Sep 22, 2026
  3. Ryan Cavanaugh (RyanCavanaugh)
    added this to the Backlog milestone on Sep 22, 2026
  4. Bjorn Pagen (bjornpagen)
    added a commit that references this issue on Nov 14, 2026

    The typecheck is incremental, and pnpm types runs it after every edit…

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

Metadata

Metadata

Assignees

  • @johnfav03
    John Favret (johnfav03)

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

    Milestone

    • BacklogNo due date

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.