a-p-z / datetime-card

A minimalistic card for Home Assistant Lovelace UI which shows how many days it has been between any input_datetime and today.
21 stars 1 forks source link

No visual editor available for type 'custom:datetime-card' #2

Closed a-p-z closed 2 years ago

a-p-z commented 2 years ago

Interesting... It says No visual editor available for type 'custom:datetime-card'.

Looking at the screenshot you provided, I've managed to get one entity on there, but on the project page you have 3 entities. How did you get that?

This is what I have.

type: custom:datetime-card
entity:
  - input_datetime.christmas_day
max: 365

Originally posted by @cjsmns in https://github.com/a-p-z/datetime-card/issues/1#issuecomment-1134448654

a-p-z commented 2 years ago

No visual editor here either, gives this message instead:

Configuration errors detected:
Cannot set property setConfig of [object HTMLElement] which has only a getter

Originally posted by @gribber in https://github.com/a-p-z/datetime-card/issues/1#issuecomment-1134782205

a-p-z commented 2 years ago

I have tried on Chromium, Firefox, and HA android app without issues. I will try to start up a new instance of HA and install the datetime-card from scratch. In the meantime, if you have any detail, post it here

gribber commented 2 years ago

It might have something to do with card-mod, which I have installed, console log shows the following:

card-mod.js:5 Uncaught (in promise) TypeError: Cannot set property setConfig of #<z> which has only a getter
    at card-mod.js:5:1163
a-p-z commented 2 years ago

@gribber, I have installed card-mod and I was able to reproduce your issue. @cjsmns and @cinghialino do you use card-mod too?

cinghialino commented 2 years ago

I have card-mod installed, yes

a-p-z commented 2 years ago

The error comes from card-mod, not from datetime-card. card-mod crashes because it tries to overwrite a method in datetime-card (setConfig) that it is immutable (has only a getter) without checking if it can overwrite that method.

Fixing card-mod, the datetime-card visual editor works.

Therefore, if you don't mind I would close the issue.

cinghialino commented 2 years ago

I would just make sure to write at the top of the description that this card won't work if you have card-mod installed.

a-p-z commented 2 years ago

I will add a few lines in the readme!

a-p-z commented 2 years ago

Just to let you know, I opened a pull request to card-mod

cinghialino commented 2 years ago

awesome, we can close it now if you want. Appreciate your commitment.

cjsmns commented 2 years ago

Yes, I also use card-mod.

Glad the issue was found.