Blueprint diagram: connection wires broken on Angular 22 — rete-angular-plugin injects removed ComponentFactoryResolver (flaky e2e tools-walk failure) #622

Closed
opened 2026-07-16 23:23:16 +00:00 by spikerj · 1 comment
Owner

Found by the E2E anonymous walk (epic #307) — anonymous-tools-walk.spec.ts › mounts diagram (/tools/(tools:diagram)), failing intermittently on spikersoft-angular CI since the Angular 22 upgrade (e.g. runs 8151 and 8153 failed while 8152 passed on the same commit).

Symptom

Opening the Blueprint diagram tool (/tools/(tools:diagram)) raises 12 uncaught TypeError: Cannot read properties of undefined (reading 'hasOwnProperty') pageerrors — one per connection in the sample diagram — and none of the connection wires render (nodes appear, wires don't). User-visible feature regression, not just test noise. The e2e failure is flaky only because the wires render ~100ms after the nodes; whether the errors land before the spec's final console-error assertion is a timing race. Reproduced locally: deterministic 12/12 errors once the diagram fully mounts.

Root cause

The batch-6 framework upgrade (spikersoft-angular #211) moved to Angular 22, which removed the ComponentFactoryResolver export (deprecated since v13). rete-angular-plugin@2.7.1 (latest; every entry point incl. /20 — which we import — and /21) still injects it in its internal ConnectionWrapperComponent:

i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver) // i0.ComponentFactoryResolver === undefined on ng22

The esbuild production build even warns: Import "ComponentFactoryResolver" will always be undefined because there is no matching export. Injecting the now-undefined token makes Angular DI call token.hasOwnProperty(...) → the TypeError, thrown once per connection component construction, so every wire silently fails to mount.

Fix

pnpm patch on rete-angular-plugin@2.7.1 (/20 and /21 fesm bundles): drop the ComponentFactoryResolver injection and use the ViewContainerRef.createComponent(Type) overload (available since Angular 13, within the plugin's own peer range). Verified locally: build warning gone, 0 pageerrors over 8 mounts, wires render, and the full anonymous-tools-walk suite (16 tools) passes. Upstream (retejs/angular-plugin) has no ng22-ready release yet — the patch can be dropped when one ships.

Fix PR: spikersoft-angular (see linked PR).

Part of epic #307.

Found by the E2E anonymous walk (epic #307) — `anonymous-tools-walk.spec.ts › mounts diagram (/tools/(tools:diagram))`, failing intermittently on spikersoft-angular CI since the Angular 22 upgrade (e.g. runs 8151 and 8153 failed while 8152 passed on the same commit). ## Symptom Opening the Blueprint diagram tool (`/tools/(tools:diagram)`) raises 12 uncaught `TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')` pageerrors — one per connection in the sample diagram — and **none of the connection wires render** (nodes appear, wires don't). User-visible feature regression, not just test noise. The e2e failure is flaky only because the wires render ~100ms after the nodes; whether the errors land before the spec's final console-error assertion is a timing race. Reproduced locally: deterministic 12/12 errors once the diagram fully mounts. ## Root cause The batch-6 framework upgrade (spikersoft-angular #211) moved to Angular 22, which **removed the `ComponentFactoryResolver` export** (deprecated since v13). `rete-angular-plugin@2.7.1` (latest; every entry point incl. `/20` — which we import — and `/21`) still injects it in its internal `ConnectionWrapperComponent`: ```js i0.ɵɵdirectiveInject(i0.ComponentFactoryResolver) // i0.ComponentFactoryResolver === undefined on ng22 ``` The esbuild production build even warns: `Import "ComponentFactoryResolver" will always be undefined because there is no matching export`. Injecting the now-`undefined` token makes Angular DI call `token.hasOwnProperty(...)` → the TypeError, thrown once per connection component construction, so every wire silently fails to mount. ## Fix `pnpm patch` on `rete-angular-plugin@2.7.1` (`/20` and `/21` fesm bundles): drop the `ComponentFactoryResolver` injection and use the `ViewContainerRef.createComponent(Type)` overload (available since Angular 13, within the plugin's own peer range). Verified locally: build warning gone, 0 pageerrors over 8 mounts, wires render, and the full `anonymous-tools-walk` suite (16 tools) passes. Upstream (retejs/angular-plugin) has no ng22-ready release yet — the patch can be dropped when one ships. Fix PR: spikersoft-angular (see linked PR). Part of epic #307.
spikerj added the bug label 2026-07-16 23:23:16 +00:00
Author
Owner

Resolved in spikersoft-angular PR #214 (merged to master, merge commit fcd0c169). Patched rete-angular-plugin@2.7.1 via pnpm patch to stop injecting the removed-in-Angular-22 ComponentFactoryResolver and use ViewContainerRef.createComponent(Type) instead — Blueprint connection wires render again and the 12 uncaught hasOwnProperty TypeErrors are gone. Master CI on the merge commit is fully green, including the previously flaky e2e-anonymous job (anonymous-tools-walk › mounts diagram). The patch can be dropped when upstream retejs/angular-plugin ships an ng22-ready release. Closing.

Resolved in spikersoft-angular PR #214 (merged to `master`, merge commit fcd0c169). Patched `rete-angular-plugin@2.7.1` via pnpm patch to stop injecting the removed-in-Angular-22 `ComponentFactoryResolver` and use `ViewContainerRef.createComponent(Type)` instead — Blueprint connection wires render again and the 12 uncaught `hasOwnProperty` TypeErrors are gone. Master CI on the merge commit is fully green, including the previously flaky `e2e-anonymous` job (`anonymous-tools-walk › mounts diagram`). The patch can be dropped when upstream retejs/angular-plugin ships an ng22-ready release. Closing.
Sign in to join this conversation.