mousePressed not working with P5.Dom button creation

Hi! I just started using the newest version of p5.js and p5.dom.js, and the mousePressed() method throws an error when a DOM button is clicked. Here is my code:

var button;

function setup(){
    button = createButton(" ");
    button.addClass("button button-primary button-border-thick button-box");

function draw(){


function logPress(){

When the button is clicked, the console gives this error message:

Uncaught TypeError: Cannot read property ‘_setProperty’ of undefined
at g.Element. (p5.min.js:7)
(anonymous) @ p5.min.js:7

I was using version 0.7.1 of both p5.js and p5.dom.js, but when I switched p5 back to version 0.6.1, this worked perfectly. Has anyone else encountered this issue??

edit: Here is my index.html code as well

<!-- Buttons core css -->
        <script src=""></script>
        <script src=""></script>

    body {
    background-color: #FFFF00 

    <script src="code.js"></script>
<link rel="stylesheet" href="css/buttons.css">

I did a little bit of reading around and I found this. Seems like it has something to do with the version that you are using? I also can assume that it will be fixed sooner or later. I personally do not know much about p5, and how you could work around this issue, but I do know that in general you could make a button with HTML, and then use JavaScript and the onclick() function to do something similar?

Hopefully this helps,

Thank so much for pointing me to this. Looks like they’re fixing it for the next release ASAP. Thanks for the reminder on the onclick() function as well!

It’s no problem! Glad I could help :smiley: