Canvas is undefined error

hi.i am using the example of custom-elements from bpmn.js examples.Now in CutomRenderer.js (custom-modeler/CustomRenderer.js),i am adding the canvas parameter in the CustomRenderer constructor along with eventBus and styles.But when accessing the canvas._svg,i am getting undefined error for canvas.I am accessing the svg in domQuery
var defs = domQuery(‘defs’, canvas._svg)

Any help in this regard is highly appreciated

Thanks

Have you added canvas to CustomRenderer.$inject?