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

Rockethouse
Shopify Partner
4 1 4

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?

Replies 16 (16)

Michel_Arteta
Shopify Partner
33 2 34

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. 

beschloo
Shopify Partner
5 0 1

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?

beschloo_0-1633380986555.png

 

109-marzouk
Visitor
1 0 0

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

beschloo
Shopify Partner
5 0 1

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

Jumbotron
Visitor
3 0 0

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

beschloo
Shopify Partner
5 0 1

beschloo_0-1634417102612.png

config.yml added to root folder

Jumbotron
Visitor
3 0 0

Where did you get the config.yml?

 

Just make it in github?

 

beschloo
Shopify Partner
5 0 1

Correct. 

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

Jumbotron
Visitor
3 0 0

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?

Not applicable

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 yourrepositorylinkgit 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).

JosueBenjaminCe
Shopify Partner
1 0 0

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

joelwe
Tourist
3 1 3

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.

JamesLiang
Shopify Partner
2 0 0

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

JamesLiang_0-1653827736710.png

 

raymondmsb
Shopify Partner
2 0 0

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

slangww
Visitor
2 0 0

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

karlhakon
Visitor
1 0 3

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)