A standalone, minimal project. The API server of @typescript/native (typescript) 7.0.2
reports TS2345 for a call that the tsgo CLI accepts in batch mode and that classic
typescript 6.0.3 accepts. Whether the server reports it differs between fresh server
processes. Within one process, the answer never changes between queries.
@typescript/native7.0.2 (installed asnpm:[email protected]; tsgo, darwin-arm64)typescript66.0.3 (installed asnpm:typescript@^6.0.3; the classic compiler, for comparison)sigma3.0.3,@sigma/utils3.0.0,graphology0.26.0,graphology-types0.24.8- node v24.21.0, macOS 26.5.1, arm64
npm install
npm run probe # 25 fresh node processes by default; each starts one tsgo API server
npm run batch # 25 runs of the tsgo CLI in batch mode by default
Give a count as the first argument: npm run probe -- 40.
probe.mjs spawns N fresh node processes. Each process builds one API
(new API({ cwd }), updateSnapshot, one getSemanticDiagnostics() query),
prints the result, and exits. The runner prints the count of processes that
report TS2345.
The server and the CLI agree: no diagnostics for this project.
tsc -p tsconfig.app.json (tsgo 7.0.2) and typescript6/bin/tsc -p tsconfig.app.json
(classic 6.0.3) both exit 0 with no output.
- Probe: 209 of 210 fresh processes reported TS2345 on
src/widgets/graph-canvas/canvas-setup.ts, at thefitViewportToNodes(renderer, [])call (measured over runs of 25, 25, 20, 20, 20, 20, 40, and 60 processes; the worst run was 19 of 20). - Batch: 0 of 30 runs reported anything (plus one batch run of 5 after each reduction step; all clean).
- Classic tsc 6.0.3: no errors.
- Within one process, five rounds of the same query gave the same answer each time.
The error:
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.
Type 'Settings<NodeAttributes, EdgeAttributes, Attributes>' is not assignable to
type 'Settings<Attributes, Attributes, Attributes>'.
Type 'Attributes' is missing the following properties from type
'NodeAttributes': x, y, size, label
The project has two source files.
src/widgets/graph-canvas/canvas-setup.tsholds the call that fails,fitViewportToNodes(renderer, []), withrenderer: GraphRendererandGraphRenderer = Sigma<NodeAttributes, EdgeAttributes>. It also holds a typed constant,const emptyDrawer: NodeHoverDrawingFunction<NodeAttributes, EdgeAttributes>, which the settings object references.src/widgets/graph-canvas/graph-canvas.tsconsumes the first file through one call,useSigma({ view, setup: (view) => canvasSetup(() => ({ selection: view() })), onMount }), whereonMountcarries the prop type(renderer: GraphRenderer) => () => void.
Each part is necessary. The reduction showed:
- One file does not flip: with the caller merged into
canvas-setup.ts, 0 of 20 processes flipped. The project needs the second file. - Without the
viewcallback chain (setup: (view) => canvasSetup(() => ({ selection: view() }))), 0 of 20 flipped. - Without
onMountin theuseSigmacall, 0 of 20 flipped.onMount: undefinedas a literal flipped weakly (1 of 20). - Without the typed
emptyDrawerconstant, the call is genuinely ill-typed: batch mode and classic tsc 6.0.3 then also report TS2345. With it, batch mode and classic tsc accept the call, and only the API server reports it. The constant changes the outcome of the assignability check in the CLI, but not in the server.
The sources do not import react or graphology. The packages stay in
package.json because this project mirrors the app; sigma's own type declarations
import graphology-types.
typescript6(npm:typescript@^6.0.3) is there only to compare the result with the classic compiler.graphologyandgraphology-typesstay, becausesigmaneedsgraphologyas a peer dependency and its type declarations importgraphology-types.
A source that does not import sigma does not flip: 0 of 20 processes. The bug needs
the type graph of sigma and @sigma/utils.