[Bug]: Theme input settings do not allow types "metaobject" or "metaobject_list"
Please confirm that you have:
- [x] Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
- [x] Reproduced the issue in the latest CLI version.
In which of these areas are you experiencing a problem?
Theme
Expected behavior
I should be able to add the input setting type of "metaobject" or "metaobject_list" and the Theme / Schema validator in theme dev would validate it and allow the theme to properly render the input settings in the Theme editor.
Actual behavior
When I add the input setting in my section liquid file using type "metaobject" or "metaobject_list", theme dev cannot validate my input setting type and prints:
Invalid schema: setting with id="faq_metaobject_list" type is invalid
Verbose output
DEBUG Refreshing preview _shopify_essential cookie
DEBUG Proxying HEAD https://mystore.myshopify.com/?preview_theme_id=139015553201&_fd=0&pb=0
DEBUG `-> 302 request_id: 6d62c030-fc60-412a-bca2-c9933404e43e-1725505530
DEBUG Proxying GET https://mystore.myshopify.com/pages/lp/chiropractic-offices?_ab=0&_fd=0&_sc=1&pb=0&preview_theme_id=139015553201&_fd=0&pb=0
DEBUG `-> 302 request_id: 9298587f-762c-4b64-abb0-bd910798222f-1725505531
DEBUG Proxying GET https://mystore.myshopify.com/pages/lp/chiropractic-offices?_ab=0&_fd=0&_sc=1&pb=0&_fd=0&pb=0
DEBUG `-> 200 request_id: 92c1bd99-23e4-46a6-8e50-0834118e50c6-1725505531
DEBUG Renew _shopify_essential cookie by the response
DEBUG Proxying GET https://mystore.myshopify.com/checkouts/internal/preloads.js?locale=en-US&_fd=0&pb=0
DEBUG [HotReload] Connected to SSE stream
DEBUG `-> 200 request_id:
DEBUG Proxying GET https://mystore.myshopify.com/cart.js?r=2.50096004167&_fd=0&pb=0
DEBUG `-> 200 request_id: fce4a8c1-6357-4c29-b79f-67076d84dc01-1725505534
DEBUG Proxying GET https://mystore.myshopify.com/pages/lp/chiropractic-offices?_ab=0&_fd=0&_sc=1&pb=0&_fd=0&pb=0
DEBUG `-> 200 request_id: c12aee9a-5636-4252-bee1-7b52148a69e7-1725505680
DEBUG Renew _shopify_essential cookie by the response
DEBUG Proxying GET https://mystore.myshopify.com/checkouts/internal/preloads.js?locale=en-US&_fd=0&pb=0
DEBUG [HotReload] Connected to SSE stream
DEBUG `-> 200 request_id:
DEBUG Proxying GET https://mystore.myshopify.com/cart.js?r=2.50093676816&_fd=0&pb=0
DEBUG `-> 200 request_id: 6835b03c-fc14-4fa2-af68-0f1ebcbf178f-1725505681
DEBUG [HotReload] Modified sections/collapsible-faqs.liquid
DEBUG update sections/collapsible-faqs.liquid
DEBUG Proxying POST https://mystore.myshopify.com/pages/lp/chiropractic-offices?_ab=0&_fd=0&_sc=1&pb=0&_fd=0&pb=0
DEBUG PUT https://mystore.myshopify.com/admin/api/unstable/themes/139015553201/assets.json with request_id: d5d0a91a-5cde-4a5d-8e8d-6bd721e08b52-1725505701
• 20:08:22 ERROR » update sections/collapsible-faqs.liquid:
Invalid schema: setting with id="faq_metaobject_list" type is invalid
DEBUG `-> 200 request_id: 5f7fe91d-5f33-4436-adad-3d164de82b7f-1725505701
DEBUG Renew _shopify_essential cookie by the response
DEBUG Proxying GET https://mystore.myshopify.com/checkouts/internal/preloads.js?locale=en-US&_fd=0&pb=0
DEBUG [HotReload] Connected to SSE stream
DEBUG Proxying POST https://mystore.myshopify.com/cart.js?r=2.50094045164&_fd=0&pb=0
DEBUG `-> 200 request_id:
DEBUG `-> 200 request_id: abcf042d-6edc-46cb-a073-f5e3c1e6527c-1725505703
Reproduction steps
I have been getting into the metaobject definitions and creating themes for these, so I can template pages and easily populate them in a set of inputs rather than coding up new files each time. Great! I was excited as it fit a need.
Created my metaobjects and then a template for them. Each template and liquid section would then bind it's input values to the values in the metaobject entry.
I have created a sales_landing_page metaobject with 2 dozen fields in it. I also have a faqs metaobject with 2 fields in it (question and answer). Each landing page does not need the same FAQs, but the most relevant ones.
This means I needed a 1:many cardinal relationship in my 2 "database tables", wanting many FAQs on one Landing Page entry.
So I created a new field on sales_landing_page as a metaobject reference, referencing the faqs metaobject.
Where I get blocked is creating a theme input setting allowing me to bind an input setting to the faq metaobject reference field on my sales_landing_page.
Except I was not sure what input setting type to use. The Shopify docs do not show any reference to metaobject or metaobject_list input setting types. HOWEVER, VScode intellisense shows me these two types, so went forward with it.
At first I just put metaobject_list but then the schema validator told me that metaobject_type was required. But I could not find ANY documentation on this either.
Intellisense provides me this link to refer to the metaobject_list input setting type, but this page makes no reference.
https://shopify.dev/docs/themes/architecture/settings/input-settings#metaobject_list
- Run
shopify theme devon an existing working theme and load your local env pages that you will work on - In a code editor, open an existing or new liquid section file, add a new input setting with
"type": "metaobject"or"type": "metaobject_list"... Here is mine:
"settings": [
...,
{
"type": "metaobject_list",
"metaobject_type": "faqs",
"id": "faq_metaobject_list",
"label": "FAQs metaobject reference"
},
...
]
- Save the file to allow for hot reloading
- See the output in the
theme devterminal where it will show:Invalid schema: setting with id="faq_metaobject_list" type is invalid
Operating System
Mac OS Sonoma 14.6.1
Shopify CLI version (check your project's package.json if you're not sure)
Shopify CLI; v=3.66.1
Shell
zsh
Node version (run node -v if you're not sure)
No response
What language and version are you using in your application?
No response
Maybe this can help? https://shopify.dev/docs/storefronts/themes/architecture/settings/dynamic-sources#referencing-metaobject-fields
Maybe this can help? https://shopify.dev/docs/storefronts/themes/architecture/settings/dynamic-sources#referencing-metaobject-fields
Thanks @etienne-ditchlabs -- I have tried this as well, but could not get it to do what I needed, given the limitations of Liquid.
Here is a similar scenario to the FAQs, but with different data.
- I have an
citationsmetaobject, which contains atopics_listthat tells me what the citation is about (ie, 'sleep','cardiovascular','anxiety') - and a
sales_landing_pagemetaobject that has a field forrelevant_citation_topics- here I want to choose which citations to show, so I will have another list of topics (ie, 'sleep','stress') - Then I want to be able to do a
containscheck to match and filter for citations that match mysales_landing_page.relevant_citation_topics - But this has proven quite difficult, perhaps not possible. The
containscheck does not ever yieldTRUEeven when the strings match exactly - This ALSO has the distinct disadvantage of having to pull ALL
citationsand then filter after, instead of being able to query using awherefilter
This isn't a bug but more of a feature suggestion to Shopify - they aren't supported as input settings within the theme editor which is why you will get the error you will.
If you view this, you can see in the sidebar what is supported: https://shopify.dev/docs/storefronts/themes/architecture/settings/input-settings
I understand now after some time and found some other ways around it.
But here is the "bug": the Shopify Liquid VScode extension pointed me in the direction of this new input type of metaobject and metaobject_list but it doesn't exist, as you've confirmed here.
Perhaps this planned feature or addition has leaked into the Liquid docs on the extension?
I understand now after some time and found some other ways around it.
But here is the "bug": the Shopify Liquid VScode extension pointed me in the direction of this new input type of
metaobjectandmetaobject_listbut it doesn't exist, as you've confirmed here.Perhaps this planned feature or addition has leaked into the Liquid docs on the extension?
I think you're right - looks like Shopify may be gearing up to add support for this in the customizer and it's sadly leaked with the a new release of the VSCode extension.
Hey @wallfly @rcasimmons , to confirm this is not a bug on the CLI but rather the Liquid VScode extension suggested invalid types, which is what caused this? If so I'll bring this feedback to the team and close this issue?
@lucyxiang Yes it all started with the Liquid VScode extension that led me to believe I could use these new input types. If that suggestion had not been there, I wouldn't have gone down this approach.
I do think that it's a worthwhile addition to the input type options for settings. I am strongly in favor of adding those. Otherwise it's hard to build a scalable relational data model with metaobjects.
Can confirm, same thing happened to me (suggestion by VS Code extension leads to trial & error and then google rabbithole which after some time leads to mild disappointment here), and same feature request from me
Facing the same issue, I've tried to use this mutation to create metaobject definition
mutation {
metaobjectDefinitionCreate(definition: {
type: "$app:product_highlight_2",
access: {
admin: MERCHANT_READ_WRITE,
storefront: PUBLIC_READ
},
capabilities: {
publishable: {
enabled: true
}
},
fieldDefinitions: [
{ key: "title", name: "Highlight Title", type: "single_line_text_field" },
{ key: "description", name: "Description", type: "multi_line_text_field" }
]
}) {
metaobjectDefinition {
id
type
fieldDefinitions {
key
name
type {
name
}
}
}
}
}
This gives me id and type, but still getting same issue Invalid tag 'schema': settings
Would be grate to know if it works for anyone at all ?
@wallfly @rcasimmons the original error is because metaobject and metaobject_list code recommendations were shipped before the metaobject and metaobject_list feature was shipped, but they are now both shipped, you can see the docs here https://shopify.dev/docs/storefronts/themes/architecture/settings/input-settings#metaobject
I'll bring feedback to the team to avoid this due to the confusion it may cause
@paxti it seems this mutation issue is unrelated to the CLI, if it's still persisting I think you'll have better luck in the dev community forum https://community.shopify.dev/
I've been trying to use the metaobject type as per documentation in this link https://shopify.dev/docs/storefronts/themes/architecture/settings/input-settings#metaobject in a theme app extension but I keep getting blocked with the following validation error whenever I set the type to metaobject or metabject_list.
bundle: [blocks/test.liquid] Invalid tag 'schema': settings: │
│ with id="test_data" type is invalid
Is this actually shipped? Can I use it? Is there an estimated timeframe for official release?
hi, any updates?
Hi! It seems there's a bug specifically in theme app blocks. We're looking into it. Really sorry for the inconvenience.
Having the same issue as @JonidBendo, specifically with a theme app extension. Any updates?
Is there an ETA or workaround on this? Tying to use metaobjects as input on block settings, throws this error and blocks deploy.
I’m encountering the same issue. It would be helpful to know if there’s an estimated timeline for a fix/workaround.
I'm also experiencing this issue.
+1
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.