BPMN-IO issue: Cannot attach diagram to Canvas


I try to display a diagram using BpmnViewer from bpmn.io.
If I use

 <div class="content">
  <div id="diagramCanvas"></div>


var BpmnViewer = window.BpmnJS;

var viewer = new BpmnViewer({ container: ‘#diagramCanvas’ });

everything works fine and the diagram is getting displayed.

But than I read the follwoing blog https://bpmn.io/blog/posts/2017-bpmn-js-0-20.html where it was mentioned, that the viewer can now be attached to any element in the DOM.
So I tried to attach the viewer to a canvas, but all I get is an empty area

My code is:

<canvas id="canvas" width="800" height="500" style="border:1px solid #000000;"></canvas>


var BpmnViewer = window.BpmnJS;
// create detached
var viewer = new BpmnViewer();
// attach it to some element

Where is my mistake?
Thanks and best regards, Roland


Make sure your container element is a div, not a canvas.That should fix your problem.