From 242efd110fe9320a207693d5b85be5d228d7eb59 Mon Sep 17 00:00:00 2001 From: Shuaib Hasan Akib Date: Fri, 2 Oct 2026 20:10:03 +0600 Subject: [PATCH] fix(devtools): stop zoom transition when disposing the tree visualizer Snapping to a node starts a 500ms d3 zoom transition that was not interrupted on dispose. If the tree visualizer is destroyed mid-transition, d3-zoom keeps reading the size of the now detached SVG and throws `NotSupportedError: Failed to read the 'value' property from 'SVGLength'`. Interrupt any running transition in `dispose()`. Tested with the router tree spec running zoneless (next commit), which fails with the error above without this change. --- .../src/lib/shared/tree-visualizer/tree-visualizer.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/devtools/projects/ng-devtools/src/lib/shared/tree-visualizer/tree-visualizer.ts b/devtools/projects/ng-devtools/src/lib/shared/tree-visualizer/tree-visualizer.ts index c472c74617e..290b9bbd143 100644 --- a/devtools/projects/ng-devtools/src/lib/shared/tree-visualizer/tree-visualizer.ts +++ b/devtools/projects/ng-devtools/src/lib/shared/tree-visualizer/tree-visualizer.ts @@ -144,6 +144,7 @@ export class TreeVisualizer extends GraphRenderer override dispose(): void { super.dispose(); + d3.select(this.containerElement).interrupt(); this.snappedNodeListenersDisposeFn?.(); }