Skip to content

Error while loading thumbnail with mermaid/plantuml/kroki diagram #127

@Gsyltc

Description

@Gsyltc

Expected

Hi,

Since the new update (2025-11-01) I cannot load thumbnail for Mermaid or Plantmul (Kroki) Diagram.

Actual

Error

SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
    at HTMLImageElement.<anonymous> (structurizr-diagram-2025.11.01.js:254:41)
structurizr-diagram-2025.11.01.js:254 Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported.
    at HTMLImageElement.<anonymous> (structurizr-diagram-2025.11.01.js:254:41)
InvalidCharacterError: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
    at svgToPng (structurizr-diagram-2025.11.01.js:4960:50)
    at convertDiagramToPNG (structurizr-diagram-2025.11.01.js:4940:16)
    at Object.exportCurrentThumbnailToPNG (structurizr-diagram-2025.11.01.js:5064:13)
    at refreshThumbnail (diagrams:2132:33)
    at viewChanged (diagrams:1994:13)
    at fireViewChangedEvent (structurizr-diagram-2025.11.01.js:329:13)
    at Object.changeView (structurizr-diagram-2025.11.01.js:365:9)
    at changeView (diagrams:2657:33)
    at diagramCreated (diagrams:2555:13)

GET https://domain/workspace/1/images/XXXXXX.png 404 (Not Found)

structurizr-diagram-2025.11.01.js
254 im.dataURL = canvas.toDataURL(structurizr.constants.CONTENT_TYPE_IMAGE_PNG);

Steps to reproduce

Open Workspace, Go to Diagram :

"Message Error"
The following images/icons failed to load - please see your web browser's developer console for more details : https://kroki.mydomain/plantuml/svg/XXXXXXX

Thunbnail for non C4 diagram are not loaded.

Other information

In light mode : C4 Diagram thumbnail are loaded (and not the others)
In dark mode : C4 diagram and others are not loaded

When I click on the thumbnail, kroki (plantuml) diagram is OK.

Version/build information

Version Structurizr on-premises - 2025.11.01 AND Lite
On both version, it the same issue

Severity

Major

Priority

Low (I have no budget and there's no rush - please fix this for free)

More information

Rollback to 2025.05.28 and all is good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions