I believe that toDataURL is on Canvas not CanvasRenderingContext2D.
https://html.spec.whatwg.org/multipage/scripting.html#canvasrenderingcontext2d

The CanvasRenderingContext2D.canvas being null, there is no way to use it.

Reply via email to