Short description of issue
Files randomly fail to import eg. product.json, and collection.json when creating a theme from GitHub
Link to Shopify Store
Reproduction steps
When I create a new theme by connecting it to a GitHub branch, some of my block files and template files fail to import. The theme log shows errors like “Invalid schema: setting with id=… default must be a color or dynamic source access path” on files that are part of the stock Horizon theme and haven’t been modified. Because those blocks don’t get created, some pages end up broken — my product page and collection page show “not found.” What’s strange is that it’s not always the same files. If I re-connect the theme, a different set fails, so it feels random rather than a real problem with the files.
Steps to reproduct:
Have a Horizon theme in a GitHub repo (the color settings use defaults like “default”: “{{ settings.color_palette.foreground }}”, exactly as Horizon ships them).
In Shopify admin, go to Online Store → Themes → Add theme → Connect from GitHub, and pick the branch.
Wait for “Creating new theme from GitHub branch” to finish, then open the GitHub integration theme log.
Additional info
A bit context of my project:
I’m building a fresh new Shopify store by folking the Horizon 4.1.1 from the official repo, no liquid code is touched yet. My branch/code management
GIthub main => live theme (always there)
Github feature branch => draft theme (creating new theme when working on different features)
I tried to replace the “default”: “{{ settings.color_palette.background }}” with a hardcode hex color for testing, and it worked fine, no errors in log anymore and all pages show correctly.
However this isn’t a proper fix to the root issue for me, as I’ll need to use the dynamic color souce, and I’ll create new theme by connecting from Github branch again when working on feature branch.
I’m looking forward to hear back from you, thanks!
What type of topic is this
Bug report
Upload screenshot(s) of issue
Thanks @Alan_Chen, I see the errors, too. Let me have a look to see what’s going on here. Thanks!
@Alan_Chen
I came across this post looking for some answers after running into what may be the same issue - hopefully this works for you, let me give you some context!
I didn’t get the color issue, but I did have the same collection.json problem and other templates files not showing up after importing the theme from GitHub, even though the files were in the repo ( after cloning the main horizon repo of course !)
After some digging, the culprit turned out to be that my node version was behind ( v20 ) and when i tried to update the CLI it wanted v22+
Prior to updating, When I ran shopify theme check, it threw several errors on Horizon 4.11; for reference, one of them was:
sections/product-list.liquid
[error]: UniqueStaticBlockId
The id ‘static-product-card’ is already being used by another static block
55 {% content_for ‘block’, type: ‘_product-card’, id:
‘static-product-card’, closest.product: null %}
To get it working I did the following:
- Update Node to v22.12.0+
- Reinstall the Shopify CLI - (
npm install -g @shopify/cli@latest)
Run shopify theme check( It should pass ! )
Run shopify theme push
After that, all templates, including collection.json were there and the theme ( so far ) is working perfectly from the starting point.
Hope this helps!
Thank you for posting about this, I was 100% convinced I’d broken my themes.
There’s no ryhme or reasoning, I’ve connected the same theme to different stores, sometimes it doesn’t sync section.liquid, another time it was contact-form.liquid - really random
@Thecharisculture I’m not sure its the CLI? As the files are on github, I can see them, they work on other stores, but when I install onto shopify via Githup connection it doesn’t copy all the files over, this is literally now;
@SRK1983 Yeah, it was pretty odd! I can’t confirm it’s 100% the issue, but when we ran Shopify theme check on the CLI version we were on, the theme failed, then after updating the CLI and node to 22 , theme check worked, then running Shopify Theme Push solved it. ( screenshot of errors below )
I bring up the CLI because the theme only failed when it was connected in via github, and as you mentioned, the collection.json existed in my local folder structure and in the actual repo, but when we looked at the folder structure via the edit code method in the UI the file did not exist.
When We downloaded Horizon from the template store, no issues, the problem only occurred for us when we tried to connect it via GitHub from our own repo, and only with 4.11 ( on 2 development stores )
-
We cloned Horizon 4.11 ( git clone GitHub - Shopify/horizon: Shopify's Horizon theme source code · GitHub )
-
Initialized it in our own repo
-
Connected to the theme via GitHub
- Noticed broken pages ( homepage was even 404 )
- Noticed the collection.json file did not exist when we looked at the templates folder via the edit code method in the UI
-
Ran Shopify Theme Check Locally ( theme failed - See reference below )
-
Updated CLI & Node
- latest cli ( @shopifyshopify/cli@4.5.1 )
- node to v22
-
Ran Shopify Theme Check ( Theme Passed )
-
Ran Shopify Theme Push
-
All files were there, and the theme loaded/worked perfectly
For us, this ended up being the fix. Perhaps there’s a larger issue afoot, creeping in behind this? Hopefully this helps!
Note: Here’s the error we got when running Shopify Theme Check prior to updating
Now, maybe having custom templates assigned on collections prior to bringing in the theme can cause the issue too? Who knows, but for us, collection.json - while existed in the repo did not make its way to the actual Shopify store for whatever reason post connection until we updated everything, validated and repushed.
I can confirm that there is an issue with connecting themes from GitHub that 4.1.1 exposed. We’ll be getting that fixed up soon.
Good to know! Quite a sneaky one! we will keep an eye out!