Github Integration: "Branch isn’t a valid theme"

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?

1 Like

Check if you have your config folder. if it’s missing Shopify will take this as invalid. If that doesn’t work let me know.

Micheal ~
Having the same issue. I have checked my folder structure and do have the config folder you speak on.

Any other tips on how to solve for this?

Did you figure out what is the cause for this error?

Even though I’m not using it while developing, iv added the config.yml file to my root folder and this seemed to work. ¯_(ツ)_/¯

Could you expand on that? Where did you add config.yml to make this work?

config.yml added to root folder

Where did you get the config.yml?

Just make it in github?

Correct.

Just create the file. Nothing has to be in it.

I added a config.yml file to the root folder then pushed to my github repo

I tried it empty and with the code from in here https://shopify.dev/themes/tools/theme-kit/configuration-reference#config-file

Still getting the error message… Any idea why?

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 run git 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).

1 Like

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.

3 Likes

Hi @joelwe Thx, I follow your method, and it works for

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)

3 Likes

Hi Michel, do you have a copy of the config.yml ?.It’s not working with a empty folder for me

This worked. I think its the files in the config folder. It adds them for you when you export the zip