catdad / canvas-confetti

🎉 performant confetti animation in the browser
https://catdad.github.io/canvas-confetti/
ISC License
10.45k stars 366 forks source link

canvas.transferToImageBitmap is not a function #232

Closed yuxxeun closed 3 months ago

yuxxeun commented 4 months ago

I got this error message when using canvas-confetti package, any idea?

image

Zatheos commented 4 months ago

I believe it's invoking this method 👇 https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas/transferToImageBitmap Possibly a problem with your code environment, or perhaps your canvas variable isn't actually a canvas at this point, if you've changed the source code?

yuxxeun commented 3 months ago

Thanks for your response @Zatheos Now, its works. But suprisingly i dont know why, maybe its becasue I'm try to install the dependencies with bun and yarn (?). End up with trying to re-clone from repositories and install all dependencies with npm i --legacy-peer-deps, and works.