You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running this code using deno run -A ... I get this error: The requested module 'https://deno.land/x/canvas@v1.4.1/mod.ts' does not provide an export named 'CanvasKitInit'
My Code:
import{CanvasKitInit}from"https://deno.land/x/canvas@v1.4.1/mod.ts"constkit=awaitCanvasKitInit({// What path would you use for locating files in deno?locateFile: (file)=>'/node_modules/canvaskit-wasm/bin/'+file,})constsurface=kit.MakeSurface(100,100)!constcanvas=surface.getCanvas()!constpaint=newkit.Paint()paint.setColor([255,0,0,255])canvas.drawCircle(25,25,20,paint)constimage=surface.makeImageSnapshot()!constbytes=image.encodeToBytes()!Deno.writeFileSync('image.png',bytes)
Before using this package I tried using canvaskit-wasm and got similar errors.
mod.ts exports a wrapper API around the canvaskit-wasm, but if you want direct access, you can import canvas from mod.ts which is the already instantiated CanvasKit object.
When running this code using
deno run -A ...
I get this error:The requested module 'https://deno.land/x/canvas@v1.4.1/mod.ts' does not provide an export named 'CanvasKitInit'
My Code:
Before using this package I tried using canvaskit-wasm and got similar errors.
Same code but with a slightly modified header:
The text was updated successfully, but these errors were encountered: