Re: shopify theme dev command breaks when changing stores

Solved

shopify theme dev command breaks when changing stores

mimi33
Excursionist
15 1 5

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:

mimi33_0-1682562588400.png

 

Can I not switch target stores during theme development?

 

Accepted Solution (1)

mimi33
Excursionist
15 1 5

This is an accepted solution.

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

 

1) open the preview link (https://<my-store-domain>?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

View solution in original post

Replies 3 (3)

Van_Nguyen_GSG
Shopify Partner
149 23 40

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>`

Helping Shopify merchants build stores that convert.
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- If you still need help, feel free to reach out to me at: van@glue.sg
Cheers!
mimi33
Excursionist
15 1 5

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

mimi33
Excursionist
15 1 5

This is an accepted solution.

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

 

1) open the preview link (https://<my-store-domain>?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