Embedding minimap leads to an error: this._canvas.findRoot is not a function

Hi,

I’m new here and I just tried to embed the minimap to my modeler. When the modeler is being displayed I got the following error:

unhandled error in event listener TypeError: this._canvas.findRoot is not a function
    at Minimap._addElement (index.esm.js:588:1)
    at index.esm.js:273:1
    at bpmn-modeler.production.min.js:7:26123

I used it the following way:

import minimapModule  from 'diagram-js-minimap';
...
this.bpmnJS = new BpmnJS({
  ...
  minimapModule
});
...
this.bpmnJS.importXML(myXML);
this.bpmnJS.get('minimap').open();

Do you have any hints what went wrong?

@Martin maybe something to look into?

Hi @Heiko ,

First of, welcome to the forum!

This one is on us. The latest release 2.1.0 of diagram-js-minimap broke backwards compatibility with earlier diagram-js Versions. I created an Issue on github to fix it: https://github.com/bpmn-io/diagram-js-minimap/issues/47

In the mean time, you can pin the version to 2.0.4.

Quick update: we released the patch version 2.1.1 which should resolve the issue

Thanks a lot, Martin. Now it works :+1:t3: