Massive Problems with a Custom Component

@ben @dan I have been working on a custom component for days and just finished it off this morning. It was a massive amount of work, but it turned out great.

I then quit and restarted Elements, but none of the properties from my component appear in the inspector.

I then decided to rename the component. What a disaster! Now it no longer works; all of the properties (a lot) never show up. The examples built with it no longer work.

So I thought, no problem —I’ll create a new component and copy the code over. But that did not work; I still end up with none of the properties I create showing in the inspector. All that shows in the inspector is the default property that was part of the original template when the component was created.

I have no idea how to recover from this. Are there any guidelines for getting something like this back on track?

Extremely disheartening after all the work that went into it. There is no way I could recreate it from scratch. I still have all the code, but it just doesn’t seem to work in Elements. I even tried a new component with a totally different name, and that won’t work either. For some reason, the properties from the original template don’t go away, even though I had deleted them.

Any help would be greatly appreciated. I doubt, though that I can provide a project that would work, as the one I have been testing this in is now broken.

If you can zip up the component and send it I’ll take a look see whats wrong.

First port of call sounds like it might be the properties. so I’d copy the contents of the file and drop it into an online json validator.

That was certainly my feeling, but the weird thing is it had been working perfectly for a couple of days. There are a lot of properties and it can be very cumbersome trying to debug them.

One of the problems is I’m using a collection in the properties and that seems to be frought with danger. Just getting it setup with no documentation was a nightmare.

I’ll ZIP up the code and send it.

1 Like

Be tomorrow before I get a look. Have to knock some nails in. :carpentry_saw::hammer:

Just a couple things spring to mind. I don’t think they will be the root of the issue but might help get back on track.

If you renamed the component and or the devpack. I don’t think any existing deployment of the component in the page would be expected to work.

Also check settings, and make sure there isn’t still a pack trying to load with the old name.

If I rename a component after developing, I tend to:

  • remove the devpack from elements settings.
  • rename the devpack
  • rename the component
  • ammend the devpack info.json
  • amend the component info.json
  • bang a new icon in there :joy:
  • add the renamed devpack back in elements settings

Aloha, Gary, thanks for all the advice.

You prompted me to revisit the properties, and after a very painstaking analysis, I found the problem. A default value had been added to a property that seemed to throw the whole thing off.

The other problem was that my collection property wasn’t working because it was pointing to the old collection info.js file. Once I fixed that, I got back on track.

However, I will be following your advice should I ever again attempt to change the name of a component. Lesson learned.

1 Like

That’s great :+1:

The more I look at the creation of properties for a custom component, it just strikes me that this is a perfect candidate for a drag and drop property list editor. The properties are nice contained elements, if they were blocks you could assemble in the order you wanted and then assign them variable names you would be off and running.

It would then almost guarantee that you could assemble an error free property list because each block would be thoroughly debugged and sealed up.

I’ll keep dreaming that this might be added to Elements one day, or possibly someone like yourself could build a tool for doing this externally and have it generate a property file.

Something like this maybe, in the Mac App Store

We discussed adding a visual properties builder at the time we were building the Component Editor. It’s totally doable and something we plan to revisit, however there’s a fair few higher priority items we need to ship first…

2 Likes

Looked at this app but it seems even harder to use than what I’m doing now. Downloaded a couple of others to try, we’ll see how it goes. Thanks.