Downloaded component installs fine, but does not once changed/re-zipped

AI-generated summary

A user, AstonJ, reports an issue where a downloaded Discourse component, after being modified and re-zipped, fails to install due to an about.json error. The original zip works fine, but a re-zipped version (even without changes) fails, suggesting a problem with the zipping process. pfaffman recommends using the Discourse Theme CLI to build and push themes, though AstonJ notes the CLI creates a large file. pfaffman insists on using the CLI for proper handling, while Heliosurge suggests using component overrides as an alternative.

I’ve downloaded the category badge component, made some changes, zipped it (right click > compress on Mac) and then when I try to Install > from your device it tells me: An error occurred: Import Error: about.json does not exist, or is invalid. Are you sure this is a Discourse Theme?

Even if I just unzip it, and then zip it (without making any changes) and then try to install it it gives me the same error.

Uploading the original .zip from my Mac works fine tho.

Only differences I can see between the two:

Original is 69KB and when you right click > info it has https://github.com/discourse/discourse-category-badge-styles/tree/main https://codeload.github.com/discourse/discourse-category-badge-styles/zip/refs/heads/main in Where from

The unzipped, then zipped (without any other changes) zip is 76KB and has nothing in Where from.

Should this be working?

I recommend that you Install the Discourse Theme CLI console app to help you build themes.

Using that creates a skeleton but has other issues: it’s 24MB compressed (so too big, discourse won’t accept it - node_modules alone is 119MB).

I just want to make a quick edit to this theme - can’t I just download, make a change then upload it as a new component with the ‘from my device’ option?

Don’t create a zip file.

Use the cli to push the edited theme back up. It’s what it’s for and makes it very easy to edit and see what you’re changes do.

An alternative you could explore is to create a new component with Overrides you want.