Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

fix(ci): the SDK type-check runs the SDK's own compiler

esengine64aea1c089cc
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 813944f19..fbee65d1b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -125,8 +125,11 @@ jobs:
- name: Install dependencies
run: pnpm install
+ # Filtered so the SDK is checked by ITS OWN pinned TypeScript (the workspace
+ # carries two majors — desktop is on 6.x); a bare root `pnpm exec tsc`
+ # resolves an arbitrary compiler. Mirrors the repo's `verify` gate exactly.
- name: Type-check SDK
- run: pnpm exec tsc --noEmit -p sdk/tsconfig.json
+ run: pnpm --filter ./sdk exec tsc --noEmit
- name: Check API surface (snapshot + release-tag policy)
run: node tools/api-surface.mjs --check
diff --git a/sdk/src/net/replication/client.ts b/sdk/src/net/replication/client.ts
index 40c90d85c..cdf3a0968 100644
--- a/sdk/src/net/replication/client.ts
+++ b/sdk/src/net/replication/client.ts
@@ -35,7 +35,7 @@ import {
} from './protocol';
import {
buildReplicationTable, cloneValue, decodeStateFrame, tableSchemas,
- type EntityRefMap, type FieldShape, type ReplicationTable, type StateFrame,
+ type EntityRefMap, type FieldShape, type ReplicationTable, type ReplicationTableEntry, type StateFrame,
} from './codec';
import { NetGhost, Replicated, type ReplicatedData } from './components';
import { NetIds } from './NetIds';
@@ -349,10 +349,12 @@ export class ReplicationClient {
const keep = Math.pow(0.5, this.fixedDelta_ / smoothing.halfLife);
const maxError = smoothing.maxError ?? Infinity;
for (const e of owned) {
- const perComp = seen.get(e);
+ // Annotated: some tsc releases flag this chain as circular
+ // inference (TS7022) without them.
+ const perComp: Map<number, Record<string, unknown>> | undefined = seen.get(e);
if (!perComp) continue;
for (const [componentId, prev] of perComp) {
- const te = this.table.entries[componentId];
+ const te: ReplicationTableEntry | undefined = this.table.entries[componentId];
if (!te || !this.world_.has(e, te.def)) continue;
const data = this.world_.tryGet(e, te.def) as Record<string, unknown>;
let changed = false;