Brooooooklyn / canvas

High performance skia binding to Node.js. Zero system dependencies and pure npm packages without any postinstall scripts nor node-gyp.
https://vercel.skia.rs
MIT License
1.78k stars 76 forks source link

loadImage stopped working in latest update (0.1.60) #935

Open aidendotgg opened 2 weeks ago

aidendotgg commented 2 weeks ago

I am using the package under Bun v1.1.34 and loadImage has started throwing errors ever since version 0.1.60. 0.1.59 and all versions below work just fine.

102 |   return new Promise((resolve, reject) => {
103 |     const image = new Image()
104 |     if (typeof alt === 'string') image.alt = alt
105 |     image.onload = () => resolve(image)
106 |     image.onerror = (e) => reject(e)
107 |     image.src = src
          ^
error: Wrap finalizer for PromiseRaw failed
 code: "ObjectExpected"

      at /home/aiden/Projects/host_backend/node_modules/@napi-rs/canvas/load-image.js:107:5
      at new Promise (1:11)
      at createImage (/home/aiden/Projects/host_backend/node_modules/@napi-rs/canvas/load-image.js:102:10)
      at /home/aiden/Projects/host_backend/node_modules/@napi-rs/canvas/load-image.js:18:71
      at loadImage (/home/aiden/Projects/host_backend/node_modules/@napi-rs/canvas/load-image.js:16:43)
      at /home/aiden/Projects/host_backend/src/utils/borders/glow.ts:58:25
      at run (/home/aiden/Projects/host_backend/src/utils/borders/glow.ts:16:36)
      at /home/aiden/Projects/host_backend/src/utils/S3Engine.ts:34:93
Brooooooklyn commented 1 week ago

@aidendotgg you should fire a issue in the bun repo

aidendotgg commented 1 week ago

@aidendotgg you should fire a issue in the bun repo

This is not a bun issue though. Version 0.1.59 and below of this package all work perfectly fine with bun but something that was changed in 0.1.60 broke it.

twlite commented 1 week ago

This is not a bun issue though. Version 0.1.59 and below of this package all work perfectly fine with bun but something that was changed in 0.1.60 broke it.

If it works on node but not in bun then it is a bug in bun

RealFascinated commented 3 days ago

0.1.59 works fine but later versions are broken on bun