Found by the P1 anonymous walk after tightening the console-error assertion (#314, epic #307) — Angular's ErrorHandler swallows this into console.error, so the previous pageerror-only assertion missed it.
Symptom
Opening /tools/(tools:blockly) logs:
ERROR TypeError: Cannot read properties of undefined (reading 'nativeElement')
at s.initializeBlockly (...)
at s.ngAfterViewInit (...)
The workspace never initializes.
Root cause
blockly.component.ts queries #blocklyDiv with a decorator @ViewChild and calls initializeBlockly() from ngAfterViewInit. The element sits inside the *transloco structural directive, whose embedded view renders only after translations load — at ngAfterViewInit the query is still undefined. Same class as the diagram tool bug fixed in spikersoft-angular#104, but a bare guard isn't enough here: the view can render afterngAfterViewInit, so guarding would leave the tool permanently uninitialized.
Fix
Signal viewChild query + an effect that runs initializeBlockly(div) exactly once when the element actually renders (idempotence via the existing workspace signal).
Found by the P1 anonymous walk after tightening the console-error assertion (#314, epic #307) — Angular's ErrorHandler swallows this into `console.error`, so the previous pageerror-only assertion missed it.
## Symptom
Opening `/tools/(tools:blockly)` logs:
```
ERROR TypeError: Cannot read properties of undefined (reading 'nativeElement')
at s.initializeBlockly (...)
at s.ngAfterViewInit (...)
```
The workspace never initializes.
## Root cause
`blockly.component.ts` queries `#blocklyDiv` with a decorator `@ViewChild` and calls `initializeBlockly()` from `ngAfterViewInit`. The element sits inside the `*transloco` structural directive, whose embedded view renders only after translations load — at `ngAfterViewInit` the query is still `undefined`. Same class as the diagram tool bug fixed in spikersoft-angular#104, but a bare guard isn't enough here: the view can render *after* `ngAfterViewInit`, so guarding would leave the tool permanently uninitialized.
## Fix
Signal `viewChild` query + an `effect` that runs `initializeBlockly(div)` exactly once when the element actually renders (idempotence via the existing `workspace` signal).
spikerj
added the bug label 2026-07-03 18:09:00 +00:00
Resolved in spikersoft-angular PR #106 (merged to master). Replaced the decorator @ViewChild with a signal viewChild + a run-once init effect, so Blockly initializes whenever the *transloco view actually renders. Verified by the tightened anonymous walk (tools spec green). Closing.
Resolved in spikersoft-angular PR #106 (merged to `master`). Replaced the decorator `@ViewChild` with a signal `viewChild` + a run-once init effect, so Blockly initializes whenever the `*transloco` view actually renders. Verified by the tightened anonymous walk (tools spec green). Closing.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found by the P1 anonymous walk after tightening the console-error assertion (#314, epic #307) — Angular's ErrorHandler swallows this into
console.error, so the previous pageerror-only assertion missed it.Symptom
Opening
/tools/(tools:blockly)logs:The workspace never initializes.
Root cause
blockly.component.tsqueries#blocklyDivwith a decorator@ViewChildand callsinitializeBlockly()fromngAfterViewInit. The element sits inside the*translocostructural directive, whose embedded view renders only after translations load — atngAfterViewInitthe query is stillundefined. Same class as the diagram tool bug fixed in spikersoft-angular#104, but a bare guard isn't enough here: the view can render afterngAfterViewInit, so guarding would leave the tool permanently uninitialized.Fix
Signal
viewChildquery + aneffectthat runsinitializeBlockly(div)exactly once when the element actually renders (idempotence via the existingworkspacesignal).Resolved in spikersoft-angular PR #106 (merged to
master). Replaced the decorator@ViewChildwith a signalviewChild+ a run-once init effect, so Blockly initializes whenever the*translocoview actually renders. Verified by the tightened anonymous walk (tools spec green). Closing.