Skip to content

fix(rsg): repair the release build broken by the findNode global check - #1099

Merged
lvcabral merged 1 commit into
masterfrom
fix/global-findnode-type-narrowing
Jul 28, 2026
Merged

fix(rsg): repair the release build broken by the findNode global check#1099
lvcabral merged 1 commit into
masterfrom
fix/global-findnode-type-narrowing

Conversation

@lvcabral

Copy link
Copy Markdown
Owner

Master is red

sgRoot.mGlobal !== this (introduced in #1096) does not compile:

RoSGNode.ts(1808,45) TS2367: This comparison appears to be unintentional
because the types 'Global' and 'this' have no overlap.

brs-scenegraph's webpack/ts-loader and tsc both reject it, so npm run build fails.

Fix

Widen to RoSGNode before comparing — the same thing the earlier global-node check in #1094 did for exactly this reason. Behavior is unchanged.

Why it got through

Only a clean build surfaces it. An incremental rebuild reuses the cached module and reports success, and the test suite then runs against the previously-built bundles. Verified: npm run clean && npm run build reproduces it on master, and passes with this change (0 TypeScript errors, both bundles emitted).

Full suite green (2240), lint and prettier clean.

🤖 Generated with Claude Code

…al check

`sgRoot.mGlobal !== this` fails to compile: mGlobal is a `Global`, which
TypeScript sees as having no overlap with the polymorphic `this`, so
`tsc`/ts-loader raise TS2367 and the brs-scenegraph build fails.

Widen to RoSGNode before comparing, the same way the earlier global-node
check did.

Only a clean build surfaces it — an incremental rebuild reuses the cached
module and reports success, which is how it reached master.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@lvcabral
lvcabral merged commit e511b64 into master Jul 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant