'TypeError: this.config is undefined' when adding card from graphical interface

Hi, I’m reconfiguring a custom card to be installable via the Lovelace graphical interface. Right now I get the error TypeError: this.config is undefined when I try to add it, and the YAML editor is shown- despite this, a complete version of the card is shown in the preview.

I’m unsure what this refers to in this context- i tried defining a config property for the custom element (in the constructor) but it didn’t seem to make a difference

Managed to figure this one out?
I’m getting the same with the custom button card

Hi, in my case I was returning the wrong class from getConfigElement()- I was returning a new instance of my main card, rather than the editor card.