Closed DjDeveloperr closed 11 months ago
Well I got it to work and it must be a TypeScript or Deno quirk. If you bind it in the constructor then the Deno kernel picks it up:
constructor(width: number, height: number, gpu = false) {
this[$display] = this[$display].bind(this);
👀 Something weird with Deno/Rust picking up the available function on this class @bartlomieju. We gotta find a minimal version that has this odd behavior.
Could you point me which one is not working here? Is it canvas.ts
or svgcanvas.ts
?
Could you point me which one is not working here? Is it
canvas.ts
orsvgcanvas.ts
?
@bartlomieju it's canvas.ts
Thanks, I'll try to take a look ASAP.
I just tried this and I got:
I think this is related to https://github.com/denoland/deno/issues/20528
So the underlying issue is that this error is raised:
TypeError: Cannot read properties of undefined (reading 'encode')\n at [Jupyter.display] (file:///Users/ib/dev/skia_canvas/src/canvas.ts:215:38)\n at <anonymous>:4:33
However I don't yet understand why that's the case. The transpiled output looks correct and AFAIK this
should be the class intance in this case. I will consult with the team and get back to you.
The bug causing it to not render properly has been fixed: https://github.com/denoland/deno/pull/20789
I had to jump to https://github.com/denoland/deno/commit/cbddf5756e07fbbe10bd35d23bb9e9c0c685442a to make it work though because deno main
can't load this module right now (#61).
Awesome fix @rgbkrk - I'll cut a release once that fix makes it to stable!
The fix for ffi is on main
.
1.37.2 is out with the fix, feel free to ship 🚢
I've released 0.5.5:
Giving your branch a spin now to see if I can find the issue you mentioned on discord.After getting everything to build I've gotten to the same issue you ran into. I even tried defining the
Symbol.for(Jupyter.display)
earlier in the code and referencing that directly.