tonyketcham / p5-svelte

Easily add p5 sketches to a Svelte project 🍛 🌱
https://p5-svelte.netlify.app
MIT License
177 stars 7 forks source link

Native p5 classes (like p5.Vector) are undefined #138

Open gwezerek opened 2 years ago

gwezerek commented 2 years ago

Describe the bug Good evening! I've been trying to get some of the p5-sound classes, like p5.Amplitude(), to work with this library. Unfortunately they remain undefined.

I noticed in the closed issues and 3.0 release that there was an attempt to fix the constructor issue. It doesn't seem to be working, based on everything I tried and the repl below.

(Thank you for making this library, btw!)

To Reproduce See the undefined in the console here: https://svelte.dev/repl/24a6a55ff03c4a65bf1b24fb58d4d575?version=3.31.2

geshl commented 11 months ago

If anyone is facing the same issue this may help: https://stackoverflow.com/questions/76465196/how-to-extend-a-p5js-class-in-svelte.