Space game initThreeJS empty catch leaves a scene without a renderer and no loading error #1080

Closed
opened 2026-08-13 13:44:05 +00:00 by spikerj · 1 comment
Owner

Found while adding Wave 8 coverage for initThreeJS (space-game.component.ts).

this.scene = new THREE.Scene() runs before new THREE.WebGLRenderer(...). If the renderer constructor throws (missing WebGL context, GPU reset, driver hiccup), the empty catch swallows the error:

  • this.scene is a live Scene
  • this.renderer stays null
  • loadingStatus is never set to an error (the missing-container path does set one)
  • HUD init never runs

The loading UI stays up with no retry signal, which matches the comment about not rethrowing at the render boundary but loses the “report the failure” half of that contract.

Would-have-caught: the Wave 8 init spec swallows a renderer constructor failure so the loading UI stays up (forces getContext to return null).

Suggested fix: in the catch, null out this.scene, set loadingStatus to a translatable init-failed string, and skip HUD/model load.

Found while adding Wave 8 coverage for `initThreeJS` (`space-game.component.ts`). `this.scene = new THREE.Scene()` runs **before** `new THREE.WebGLRenderer(...)`. If the renderer constructor throws (missing WebGL context, GPU reset, driver hiccup), the empty `catch` swallows the error: - `this.scene` is a live Scene - `this.renderer` stays `null` - `loadingStatus` is never set to an error (the missing-container path does set one) - HUD init never runs The loading UI stays up with no retry signal, which matches the comment about not rethrowing at the render boundary but loses the “report the failure” half of that contract. Would-have-caught: the Wave 8 init spec `swallows a renderer constructor failure so the loading UI stays up` (forces `getContext` to return null). Suggested fix: in the catch, null out `this.scene`, set `loadingStatus` to a translatable init-failed string, and skip HUD/model load.
Author
Owner

Resolved in spikersoft-angular PR #819 (merged to master). initThreeJS no longer leaves a scene without a renderer and no loading error. Closing.

Resolved in spikersoft-angular [PR #819](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/819) (merged to `master`). initThreeJS no longer leaves a scene without a renderer and no loading error. Closing.
Sign in to join this conversation.