An exception arises after calling Diagram.Undo() for SVG Node Type

Dear Support Team,

I am encountering the error displayed below while attempting to relocate an SVG node named "NodeD" from its parent container, as detailed in the attached VS 2022 solution.

To view the specific error, please visit the following project's page : https://localhost:7204/diagram_svg_shape

Additionally, there is another page, "https://localhost:7204/diagram_basic_shape," which features a basic shape for NodeD. On that page, everything functions correctly, and there are no issues when moving NodeD out of its parent container.

Best regards


Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass82_0.<RenderNative>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass56_0.<RenderElement>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass59_0.<RenderChildElements>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass57_0.<RenderContainer>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass56_0.<RenderElement>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass59_0.<RenderChildElements>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass57_0.<RenderContainer>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass56_0.<RenderElement>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass59_0.<RenderChildElements>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass57_0.<RenderContainer>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass56_0.<RenderElement>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramRenderer.<>c__DisplayClass51_0.<RenderNodes>b__0(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)
   at Syncfusion.Blazor.Diagram.Internal.DiagramLayerContent.BuildRenderTree(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)



Attachment: DiagramSVG_91747892.zip

5 Replies

RS Ramya Subramani Syncfusion Team September 15, 2025 02:10 PM UTC

Hi John,

We were able to reproduce  the reported issue. We are currently validating the issue and will provide additional information as soon as possible.

Regards,

Ramya




JO John September 15, 2025 02:39 PM UTC

Thank you Ramya

I look forward to your feedback.


.



JJ Jawin John Syncfusion Team September 17, 2025 12:55 PM UTC

Hi John,


Reported issue:  Exception occurs when dragging an SVG node from container followed by undo action
 

We have confirmed that the reported issue is a bug and have logged a defect report regarding it. We will fix the issue and include the fix in our upcoming weekly NuGet release, which is expected to be rolled out on "Oct 7, 2025". We appreciate your patience until then. 
 

Meanwhile, you can track the status of the bug at the following link:

Feedback Link:  https://www.syncfusion.com/feedback/70105/exception-occurs-when-dragging-an-svg-node-from-container…

 

Disclaimer: The inclusion of this solution in the weekly release may change due to other factors, including but not limited to QA checks and work reprioritization.

 

Best Regards,

Jawin




JO John September 19, 2025 03:12 AM UTC

Noted, Thank you for your feedback.

Best Regards



RS Ramya Subramani Syncfusion Team October 7, 2025 09:29 AM UTC

Hi John,

We have fixed the reported issue  “An exception arises after calling Diagram.Undo() for SVG Node Type” and included the fix in our weekly patch release(31.1.23). Please update the “Syncfusion.Blazor.Diagram” package to the latest version in your application to resolve the reported issue. Please find the package link below.

https://www.nuget.org/packages/Syncfusion.Blazor.Diagram


Root Cause: 

The issue occurs because the SVG node is being added to the container after its properties are updated. When property updates are executed before the node is attached to the container's children, it leads to an exception.


Best Regards,

Ramya



Loader.
Up arrow icon