Skip to content

7.1 regression: TS2339 in a self-referencing object literal is dropped when another file on the same checker hits the same error first #65483

Description

🔎 Search Terms

TS2339 missing, error not reported, deferred diagnostics, produceDeferredDiagnostics, addDeferredDiagnostic, singleThreaded, checkers, ts-expect-error, self-referencing object literal, typescript-go#4640

🕗 Version & Regression Information

  • This changed between versions 7.1.0-dev.20260715.1 and 7.1.0-dev.20260717.1
  • This changed in commit or PR: probably Always accumulate deferred diagnostics typescript-go#4640 ("Always accumulate deferred diagnostics"). I bisected to that nightly range, not to the commit. Of the 12 commits in the range (448614f8f4...b8276f35cd), Proposal: 'typeon' operator #4640 is the one that changes how diagnostics are reported, and it moves this TS2339 into a deferred callback.
  • Still present in 7.1.0-beta and 7.1.0-dev.20261113.1. 5.9.3, 6.0.3, 7.0.2 and 7.1.0-dev.20260715.1 report the error.

⏯ Playground Link

None. The repro needs two files and --singleThreaded.

💻 Code

a.ts

import type { T } from "./b";

export const Obj = {
  Updaters: {
    Template: {
      commitError: (v: T) => Obj.Updaters.Core.commitError(v),
    },
  },
};

b.ts

import { Obj } from "./a";

export type T = number;
export const x = Obj.Updaters.Core.simpleModal;

tsconfig.json

{ "compilerOptions": { "strict": true, "noEmit": true, "target": "esnext", "module": "esnext", "moduleResolution": "bundler", "skipLibCheck": true, "lib": ["esnext"] }, "files": ["a.ts", "b.ts"] }

Run tsc -p . --singleThreaded.

🙁 Actual behavior

7.1.0-dev.20261113.1 reports only the error in b.ts:

b.ts(4,31): error TS2339: Property 'Core' does not exist on type '{ Template: { commitError: (v: number) => any; }; }'.

The same access in a.ts (line 6) is not reported.

It gets worse when the access in b.ts is suppressed. Put // @ts-expect-error on the line above export const x in b.ts, and tsc -p . --singleThreaded prints nothing and exits 0, though a.ts still has an invalid property access.

Without --singleThreaded, both errors are reported in this two-file program, presumably because the two files land on different checkers. We first hit this in a 40'000-file project with the default checker count, where a state object and the file that imports it ended up on the same checker. We then confirmed the missing error there with typescript@7.1.0-beta --singleThreaded.

🙂 Expected behavior

Both errors, as in 7.0.2:

a.ts(6,43): error TS2339: Property 'Core' does not exist on type '{ Template: { commitError: (v: number) => any; }; }'.
b.ts(4,31): error TS2339: Property 'Core' does not exist on type '{ Template: { commitError: (v: number) => any; }; }'.

With the @ts-expect-error in b.ts, the a.ts error and a non-zero exit code. The result should not depend on which checker a file is assigned to.

Additional information about the issue

No response

Activity

  1. added
    Bug
    Domain: check: Order Dependence
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDomain: check: Order Dependence

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions