Uncaught TypeError: canvas.findRoot is not a function

Hi,

I use bpmn-js in version 8.10.0 with diagram-js 8.2.1. I got following error, if I use the modeler and select a task in the diagram.

image

The error seams to be similar to the error in following post: Embedding minimap leads to an error: this._canvas.findRoot is not a function

It worked in previous version of bpmn-js and diagram-js.

Best Regards,
Anja

To get the root element of the canvas, you could use: canvas.getRootElement()

Hi Heiko,

this is not code on my side.
I just start my modeler and select by click on the task one activtity and this error is occured.

image

Do you know this part?
BR Anja

bpmn-js@8.10 is using diagram-js@7.8 under the hood, and the Canvas.findRoot was added via diagram-js@8. Maybe you have an implementation mismatch here.

Are you able to share your setup inside a CodeSandbox? This way it would be easier for us to check what’s going on.

Hi Niklas,

many thanks for the very fast replies from your side.
I discovered a very strange situation. In my custom bundle the code area ‘Selection.prototype.select’ was integrated twice and one times with ‘canvas.findRoot()’. After I run ‘npm update’ I got a lot of changes and now no further place with ‘canvas.findRoot()’. I guest this issue is solved. :smiley:

Many Thanks, Anja

1 Like

I’m happy to hear your issue was resolved :+1: Thanks also for sharing your solution!