cli: [Bug]: Theme input settings do not allow types "metaobject" or "metaobject_list"
Please confirm that you have:
- 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.)
- 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
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 20 (4 by maintainers)
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