Thanks for your help Mayker, but I figured out what’s going bad.
Your custom-card is not the cause
It was decluttering-card which I use. In my template I use a custom:button-card. In this configuration, you MUST have decluterring-card js file to be included AFTER button-card js file.
If not, the decluttering-card is not finding the button-card element and display an error.
I tried so many things before trying this…
Sorry for the confusion, but a comment in another thread has make beleive this problem was solved by custom-header.
Thanks for your time and great job !
this method seems to improve the loading but is not bullet proof. Sometimes I have still some errors. Anyway, I spent too much time in this debug ^^