Getting this error for a theme that I know is perfectly valid because I can upload it just fine as a zip or using the old theme-kit cli tool.
I’m using a git worktree branch for my built theme directory and was able to successfully load this into another store, but not on this particular one.
There is no documentation or extended information on why the branch or theme may be invalid, so how are you meant to debug this?
Hey Im not sure if anyone is still having this issue but maybe this will help. Once you Initialize your theme and then name your theme via the shopify cli, make sure you change directories so that you are inside of that theme folder you named earlier and then try pushing to your empty respository on github. Inside your actual theme folder first run shopify theme check (You shouldn’t have a whole bunch of errors and missing folders, only 1 offense, if you get 100s of offenses then you most likely aren’t in your actual theme folder) . Next rungit init, git remote add origin yourrepositorylink, git add . , git commit -m “initial commit lol” . For the last step i opted to use git push origin master. Let me know if this helped anyone.
In conclusion you want to make sure you are pushing your actual theme folder to the empty respository and not its parent directory(folder).
What worked for me was to first download the theme file to my computer. Then unzip the theme files into a folder. Then create a repo on Github. Then git add all theme files and push it to the repo. Then go to Theme library > Add theme > Connect from Github.
This video helped me figure the problem out. Shopify doesn’t seem to allow you to upload Hydrogen builds like normal themes. Basically you have to go to ‘Additional Sales Channels’ and add Hydrogen as an app. Video Link
The solution for me, mentioning it here since I haven’t found it elsewhere:
It’s important that the root of the branch you are using does not contain a subfolder with your theme, but that all the theme-folders are on the root-folder (together with readme and config.yml)