Shopify theme dev command breaks when changing stores

I am developing a new theme for my existing store.

Previously, I was running shopify theme dev --store <my-production-store> which was running fine.

Now I have opened a new development store, and I want to switch the target store to this store.

However when I run shopify theme dev --store <my-development-store>, then none of the theme code is applied. Here is a screenshot of how the theme is breaking:

Can I not switch target stores during theme development?

Hi Mimi33,

If you want to switch between accounts, first you need to log out of the current account using the command:

shopify auth logout

Then run shopify theme dev --store <my-development-store>

even after running shopify auth logout I am still facing the same issue

managed to fix this by adding config/settings_schema.json from an existing theme. detailed steps below

  1. open the preview link (https://?preview_theme_id=xxx)

  2. an error message stating “Theme cannot be previewed because it’s missing one of these required files: layout/theme.liquid, config/settings_schema.json”

  3. go to admin > online store > edit code, and copy the existing config/settings_schema.json

  4. go back to my editor, and create file config/settings_schema.json, then paste the contents

  5. re-run shopify theme dev

for some reason, it was working on my first store, but failed on the second

  • I tried manually copying these two files from server to local and restarted the CLI but still same issue.
  • I tried shopify auth logout and then did shopify theme dev --store=mystorename.myshopify.com and authenticated again with Shopify partner login credentials, but still same issue
  • I tried shopify theme pull to pull all files from server and retry but still same issue.
Theme cannot be previewed because it's missing one of these required files: layout/theme.liquid, config/settings_schema.json

I found a workaround of this - if you have .shopifyignore file, remove it or delete the code inside of it and then run shopify theme pull.

This will pull all files from server to local, in your feature branch you are doing this, now run shopify theme dev and this will show your local instance of store up and running, now you undo the .shopifyignore and then discard the changes which are showing in your git, and start your feature branch from the point of coding time you left, happy coding.