Repro: https://github.com/vivere-dally/tsgo-api-ts2345-repro
@typescript/native (typescript) 7.0.2, darwin-arm64, node v24.21.0, macOS 26.5.1. The project uses sigma 3.0.3 and @sigma/utils 3.0.0. strict is not set.
Steps
npm install
npm run probe. The script starts 25 fresh node processes. Each process makes one new API({ cwd }) of @typescript/native/unstable/sync, calls updateSnapshot once, and reads program.getSemanticDiagnostics() once.
npm run batch. The script runs tsc -p tsconfig.app.json 25 times.
Expected
The server and tsc give the same diagnostics for the same project and options.
Actual
tsc: 0 of 25 runs report an error. Classic typescript 6.0.3 also reports no error.
- The server: 25 of 25 processes report TS2345. An earlier run gave 209 of 210.
error TS2345: Argument of type 'GraphRenderer' is not assignable to parameter of
type 'Sigma<Attributes, Attributes, Attributes>'.
The types returned by 'getSettings()' are incompatible between these types.
The call is fitViewportToNodes(renderer, []) in src/widgets/graph-canvas/canvas-setup.ts.
Observations
- One process gives the same answer in five queries. Thus the difference comes from program or checker construction.
- The project needs both source files. With the caller merged into
canvas-setup.ts, 0 of 20 processes report the error.
- Without the typed constant
emptyDrawer, tsc also reports TS2345. With the constant, tsc accepts the call, and the server does not.
- In the full application that this comes from, about one server process in four reports the error.
The server result seems to depend on the order of type checks. I do not know which of the two answers is correct.
Repro: https://github.com/vivere-dally/tsgo-api-ts2345-repro
@typescript/native(typescript) 7.0.2, darwin-arm64, node v24.21.0, macOS 26.5.1. The project usessigma3.0.3 and@sigma/utils3.0.0.strictis not set.Steps
npm installnpm run probe. The script starts 25 fresh node processes. Each process makes onenew API({ cwd })of@typescript/native/unstable/sync, callsupdateSnapshotonce, and readsprogram.getSemanticDiagnostics()once.npm run batch. The script runstsc -p tsconfig.app.json25 times.Expected
The server and
tscgive the same diagnostics for the same project and options.Actual
tsc: 0 of 25 runs report an error. Classictypescript6.0.3 also reports no error.The call is
fitViewportToNodes(renderer, [])insrc/widgets/graph-canvas/canvas-setup.ts.Observations
canvas-setup.ts, 0 of 20 processes report the error.emptyDrawer,tscalso reports TS2345. With the constant,tscaccepts the call, and the server does not.The server result seems to depend on the order of type checks. I do not know which of the two answers is correct.