Skip to content

p5 version 2.0 compatibility #24

@bummzack

Description

@bummzack

Hi, thanks for creating this.
I tried using Poline in P5, version 2.0.5, but it doesn't seem to work. I also tried to just import it "regularly", eg. something like:

let Poline;
async function setup() {
  ({Poline} = await import('https://unpkg.com/poline?module'))
}

But then I get an Error like this:

TypeError: P.prototype.registerMethod is not a function

Which is most likely because Poline detects P5, but wants to register itself the way it was done in P5 v1.

I think it might be worthwile to check the P5 version (p5.VERSION) and/or wrap the whole p5 initialisation in a try/catch block, so that Poline can still be imported/used as above. What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions