I am trying to develop the whole site locally first with all the data. When I will be DONE, I will push it to live.
But everyday when I am starting the project using CLI command "shopify theme dev", I get to see that all my previous added data/content, is lost. Whereas the image files are still there in the media library. But none of the blocks retain their content in their respective fields.
How is all the data getting lost everyday? I am very much confused, is this a bug in Shopify? Please check the video link here to refer to my issue & help me out.
Before you run shopify theme dev you need to create a deleopment theme to pull your changes from the customizer using the shopify theme pull command and only then run shopify theme dev. Because when you save your changes in the customizer, your settings_data.json is not changed locally
When I am developing locally using Shopify CLI then none of the data i have added during my work stays after push. All the data that i have added during development from local gets lost.
Thank you for your reply. To solve this problem you should create a development theme in your store and upload your code there, then you need to open two shopify cli terminals in one run shopify theme dev --store [store-name.myshopify.com] --theme [your_theme id from store]. After making changes in customizer you need to run shopify theme pull --store [store-name.myshopify.com] --theme [your_theme id from store] to pull down the changes, and after re-running shopify theme dev ... your changes from the customizer will remain. The shopify theme dev command sends the changes you had in your code but does not take them out of the customizer
In the live site when I am adding the content in the home-page, then those data are actually found in the file index.json, please check the screenshot below.
But when I am working locally using Shopify CLI with local frontend url then after adding the data from the customize theme editor link, those data are not found in the index.json file, please check the screenshot below.
The data in the index.json file are not getting generated when I am working locally using Shopify CLI. Can you please explain why?
Because in your case cli creates a virtual development environment that is not related to the store, so the changes from the customizer will not be applied
Make the shift from discounts to donations, and witness your business not only thrive fina...By Holly Dec 4, 2023
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...By Arno Nov 27, 2023