Shopify / cli

Build apps, themes, and hydrogen storefronts for Shopify
https://shopify.dev
MIT License
433 stars 129 forks source link

[Bug]: CLI doesn't update the theme #3743

Closed loopcatalin closed 6 months ago

loopcatalin commented 6 months ago

Please confirm that you have:

In which of these areas are you experiencing a problem?

Theme

Expected behavior

Shopify CLI should update all the theme files on the localhost and customiser/preview themes

Actual behavior

Shopify CLI isn't updating any of the theme files on the localhost and customiser/preview themes. We tried updating to the latest CLI and this is an error which is also happening to my colleagues, not only on my end.

Verbose output

2024-04-18T15:32:50.565Z: Running command theme dev
2024-04-18T15:32:50.577Z: Ensuring that the user is authenticated with the Theme API with the following scopes:
[]

2024-04-18T15:32:50.577Z: Ensuring that the user is authenticated with the Admin API with the following scopes for the store loopearplugs.myshopify.com:
[]

2024-04-18T15:32:50.577Z: Getting session store...
2024-04-18T15:32:50.579Z: Validating existing session against the scopes:
[
  "openid",
  "https://api.shopify.com/auth/shop.admin.graphql",
  "https://api.shopify.com/auth/shop.admin.themes",
  "https://api.shopify.com/auth/partners.collaborator-relationships.readonly",
  "https://api.shopify.com/auth/shop.storefront-renderer.devtools",
  "https://api.shopify.com/auth/partners.app.cli.access",
  "https://api.shopify.com/auth/destinations.readonly"
]
For applications:
{
  "adminApi": {
    "scopes": [],
    "storeFqdn": "loopearplugs.myshopify.com"
  }
}

2024-04-18T15:32:50.579Z: Sending Identity Introspection request to URL: https://accounts.shopify.com/oauth/introspection
2024-04-18T15:32:50.579Z: Sending POST request to URL https://accounts.shopify.com/oauth/introspection
With request headers:
 - User-Agent: Shopify CLI; v=3.59.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2024-04-18T15:32:50.895Z: Request to https://accounts.shopify.com/oauth/introspection completed in 308 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"4e2378f3d2a9369f61b008447190e7f1"
 - x-request-id: 7c654dd5-dfd5-4d96-91c1-47456e3fbc0e-1713454370

2024-04-18T15:32:50.899Z: The identity token is valid: true
2024-04-18T15:32:50.899Z: 
The validation of the token for application/identity completed with the following results:
- It's expired: false
- It's invalid in identity: false

2024-04-18T15:32:50.899Z: The current session is valid but needs refresh. Refreshing...
2024-04-18T15:32:50.900Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=refresh_token&access_token=atkn_CjQIoe2EsQYQwaWFsQZSJggBEhBToWwsftVFp5GOmTjReQkxGhDBaSlq4yRN8qGGy5Q1eJVtEkAvfnbvDiw-nk_IgDgbpi5YaqDqUpCb9DF4XtEuyClmPLHUjvyVWe0tctlWZrgtBJ2mpDT1VjgczhMmYWNRZ8wE&refresh_token=atkn_CiEIoe2EsQYQoYejsgaiARIKEMFpKWrjJE3yoYbLlDV4lW0SQGe6pvWgJLhsM863tjcfW7js7BW1esP-nQKZxfmjmzbqA8J9zJZ7WX8RWscgxkvyb4mOoZK_pyvYrQ4mVQPyVA8&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3
With request headers:
 - User-Agent: Shopify CLI; v=3.59.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2024-04-18T15:32:51.211Z: Request to https://accounts.shopify.com/oauth/token?grant_type=refresh_token&access_token=atkn_CjQIoe2EsQYQwaWFsQZSJggBEhBToWwsftVFp5GOmTjReQkxGhDBaSlq4yRN8qGGy5Q1eJVtEkAvfnbvDiw-nk_IgDgbpi5YaqDqUpCb9DF4XtEuyClmPLHUjvyVWe0tctlWZrgtBJ2mpDT1VjgczhMmYWNRZ8wE&refresh_token=atkn_CiEIoe2EsQYQoYejsgaiARIKEMFpKWrjJE3yoYbLlDV4lW0SQGe6pvWgJLhsM863tjcfW7js7BW1esP-nQKZxfmjmzbqA8J9zJZ7WX8RWscgxkvyb4mOoZK_pyvYrQ4mVQPyVA8&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3 completed in 309 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"307ae120f320f1c52773f2c5b3f94c98"
 - x-request-id: e81c9e05-1be2-4989-a3a3-c14a37807421-1713454371

2024-04-18T15:32:51.213Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=271e16d403dfa18082ffb3d197bd2b5f4479c3fc32736d69296829cbb28d41a6&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.app.cli.access&subject_token=****
With request headers:
 - User-Agent: Shopify CLI; v=3.59.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2024-04-18T15:32:51.213Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=ee139b3d-5861-4d45-b387-1bc3ada7811c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.storefront-renderer.devtools&subject_token=****
With request headers:
 - User-Agent: Shopify CLI; v=3.59.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2024-04-18T15:32:51.213Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=32ff8ee5-82b8-4d93-9f8a-c6997cefb7dc&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly&subject_token=****
With request headers:
 - User-Agent: Shopify CLI; v=3.59.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2024-04-18T15:32:51.213Z: Sending POST request to URL https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.admin.graphql+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.admin.themes+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly&subject_token=****&destination=https%3A%2F%2Floopearplugs.myshopify.com%2Fadmin
With request headers:
 - User-Agent: Shopify CLI; v=3.59.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2024-04-18T15:32:51.493Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=ee139b3d-5861-4d45-b387-1bc3ada7811c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.storefront-renderer.devtools&subject_token=**** completed in 277 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"3cfd1a4e2d43590fef23a6fa984a1f14"
 - x-request-id: 8e3618ab-478f-4d9a-895d-83a152b6410e-1713454371

2024-04-18T15:32:51.496Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=32ff8ee5-82b8-4d93-9f8a-c6997cefb7dc&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly&subject_token=**** completed in 280 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"b9ec525bfe5320cf4c874311f64d0b3a"
 - x-request-id: 3f19b437-7d2c-4a4c-bcff-9f7a7de3697a-1713454371

2024-04-18T15:32:51.507Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.admin.graphql+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshop.admin.themes+https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly&subject_token=****&destination=https%3A%2F%2Floopearplugs.myshopify.com%2Fadmin completed in 289 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"8dba4d41caae39ebdd581bcd572c41fe"
 - x-request-id: c279d198-875c-418c-8c35-0419918b3f19-1713454371

2024-04-18T15:32:51.703Z: Request to https://accounts.shopify.com/oauth/token?grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Atoken-exchange&requested_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&subject_token_type=urn%3Aietf%3Aparams%3Aoauth%3Atoken-type%3Aaccess_token&client_id=fbdb2649-e327-4907-8f67-908d24cfd7e3&audience=271e16d403dfa18082ffb3d197bd2b5f4479c3fc32736d69296829cbb28d41a6&scope=https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.app.cli.access&subject_token=**** completed in 488 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"7299503f1117ff88f4fd730fcee18cee"
 - x-request-id: ed8039ea-5c0d-4067-a781-a2d2fe09a0df-1713454371

2024-04-18T15:32:51.705Z: Setting session store...
2024-04-18T15:32:51.713Z: Ensuring that the user is authenticated with the Storefront API with the following scopes:
[]

2024-04-18T15:32:51.714Z: Getting session store...
2024-04-18T15:32:51.715Z: Validating existing session against the scopes:
[
  "openid",
  "https://api.shopify.com/auth/shop.admin.graphql",
  "https://api.shopify.com/auth/shop.admin.themes",
  "https://api.shopify.com/auth/partners.collaborator-relationships.readonly",
  "https://api.shopify.com/auth/shop.storefront-renderer.devtools",
  "https://api.shopify.com/auth/partners.app.cli.access",
  "https://api.shopify.com/auth/destinations.readonly"
]
For applications:
{
  "storefrontRendererApi": {
    "scopes": []
  }
}

2024-04-18T15:32:51.715Z: Sending Identity Introspection request to URL: https://accounts.shopify.com/oauth/introspection
2024-04-18T15:32:51.715Z: Sending POST request to URL https://accounts.shopify.com/oauth/introspection
With request headers:
 - User-Agent: Shopify CLI; v=3.59.0
 - Keep-Alive: timeout=30
 - Sec-CH-UA-PLATFORM: darwin
 - Content-Type: application/json

2024-04-18T15:32:51.981Z: Request to https://accounts.shopify.com/oauth/introspection completed in 264 ms
With response headers:
 - cache-control: no-cache, no-store, private, must-revalidate, max-age=0
 - content-type: application/json; charset=utf-8
 - etag: W/"2826d29a2827c52a80b5018a42b72896"
 - x-request-id: 853cc64d-8f9e-4c20-893a-84be0ec54670-1713454371

2024-04-18T15:32:51.983Z: The identity token is valid: true
2024-04-18T15:32:51.983Z: 
The validation of the token for application/identity completed with the following results:
- It's expired: false
- It's invalid in identity: false

2024-04-18T15:32:51.990Z: 
Running system process:
  · Command: /opt/homebrew/opt/ruby/bin/ruby -v
  · Working directory: /Users/catalinsetraru/loopearplugs/dawn-loop

2024-04-18T15:32:52.000Z: 
Running system process:
  · Command: /opt/homebrew/opt/ruby/bin/bundle -v
  · Working directory: /Users/catalinsetraru/loopearplugs/dawn-loop

2024-04-18T15:32:52.117Z: Reading the content of file at /opt/homebrew/Cellar/shopify-cli/3.59.0/libexec/lib/node_modules/@shopify/cli/dist/assets/cli-ruby/Gemfile...
2024-04-18T15:32:52.118Z: 
Running system process:
  · Command: /opt/homebrew/opt/ruby/bin/bundle install
  · Working directory: /opt/homebrew/Cellar/shopify-cli/3.59.0/libexec/lib/node_modules/@shopify/cli/dist/assets/cli-ruby

2024-04-18T15:32:52.399Z: 
Running system process:
  · Command: /opt/homebrew/opt/ruby/bin/bundle exec /opt/homebrew/opt/ruby/bin/ruby /opt/homebrew/Cellar/shopify-cli/3.59.0/libexec/lib/node_modules/@shopify/cli/dist/assets/cli-ruby/bin/shopify theme token --admin atkn_Cp8DCKP6hLEGEMOyhbEGYpADCAESEOgm8Y5SMUqlrfEHuwg6hGsaqAFodHRwczovL2FwaS5zaG9waWZ5LmNvbS9hdXRoL3BhcnRuZXJzLmNvbGxhYm9yYXRvci1yZWxhdGlvbnNoaXBzLnJlYWRvbmx5IGh0dHBzOi8vYXBpLnNob3BpZnkuY29tL2F1dGgvc2hvcC5hZG1pbi5ncmFwaHFsIGh0dHBzOi8vYXBpLnNob3BpZnkuY29tL2F1dGgvc2hvcC5hZG1pbi50aGVtZXMgDSinUzIQSy_6j-ziRMquqDmg6Z-TxjokZTMzNDQ1ZWItOWNhYy00YzBjLWFlNTUtYjc3YmNmMDYxOWI4QgdBY2NvdW50ShAtVhR24bxKgrY9zX1KcOXeUlN7InN1YiI6ImZiZGIyNjQ5LWUzMjctNDkwNy04ZjY3LTkwOGQyNGNmZDdlMyIsImlzcyI6Imh0dHBzOi8vYWNjb3VudHMuc2hvcGlmeS5jb20ifWIQ8dIopN2_QOaip8_wAo6qUWoQ-g6WeiJMRwO0EttJQr16dBJAfvSbMGOdpMjArPAX6x_FIgkB6pY1tpvRaeDGNeWzGg2SWMNkiEdXykUwEJIU29lMnLoQyhXQ90CDMnLeO4nEBQ --sfr atkn_CqMCCKP6hLEGEMOyhbEGYpQCCAESEAA6xq3MWU0YtP_8EksIY8IaPmh0dHBzOi8vYXBpLnNob3BpZnkuY29tL2F1dGgvc2hvcC5zdG9yZWZyb250LXJlbmRlcmVyLmRldnRvb2xzINhSKKdTOiRlMzM0NDVlYi05Y2FjLTRjMGMtYWU1NS1iNzdiY2YwNjE5YjhCB0FjY291bnRKEC1WFHbhvEqCtj3NfUpw5d5SU3sic3ViIjoiZmJkYjI2NDktZTMyNy00OTA3LThmNjctOTA4ZDI0Y2ZkN2UzIiwiaXNzIjoiaHR0cHM6Ly9hY2NvdW50cy5zaG9waWZ5LmNvbSJ9YhDx0iik3b9A5qKnz_ACjqpRahD6DpZ6IkxHA7QS20lCvXp0EkAXfyyuLsRIZU9y6xc6nIReh1Yy4xKqxb6-qsRWEXFlmY4PdAqm8PMeyNCixWvAKf0cA2Uos-NCol1t-UFbqCoP
  · Working directory: /Users/catalinsetraru/loopearplugs/dawn-loop

2024-04-18T15:32:52.971Z: Getting development theme...
2024-04-18T15:32:53.345Z: Request to https://loopearplugs.myshopify.com/admin/api/unstable/themes/161433092431.json?fields=id%2Cname%2Crole%2Cprocessing completed in 371 ms
With response headers:
 - content-type: application/json; charset=utf-8
 - x-request-id: 63e61745-7174-409f-aeea-a6996bd16b9d-1713454373

╭─ success ─────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                       │
│  Preview your theme                                                                                   │
│    • http://127.0.0.1:9292                                                                            │
│                                                                                                       │
│  Next steps                                                                                           │
│    • Customize your theme at the theme editor                                                         │
│    • Share your theme preview (https://loopearplugs.myshopify.com/?preview_theme_id=161433092431)     │
│                                                                                                       │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯

2024-04-18T15:32:53.381Z: 
Running system process:
  · Command: /opt/homebrew/opt/ruby/bin/ruby -v
  · Working directory: /Users/catalinsetraru/loopearplugs/dawn-loop

2024-04-18T15:32:53.386Z: 
Running system process:
  · Command: /opt/homebrew/opt/ruby/bin/bundle -v
  · Working directory: /Users/catalinsetraru/loopearplugs/dawn-loop

2024-04-18T15:32:53.467Z: Reading the content of file at /opt/homebrew/Cellar/shopify-cli/3.59.0/libexec/lib/node_modules/@shopify/cli/dist/assets/cli-ruby/Gemfile...
2024-04-18T15:32:53.468Z: 
Running system process:
  · Command: /opt/homebrew/opt/ruby/bin/bundle install
  · Working directory: /opt/homebrew/Cellar/shopify-cli/3.59.0/libexec/lib/node_modules/@shopify/cli/dist/assets/cli-ruby

2024-04-18T15:32:53.739Z: 
Running system process:
  · Command: /opt/homebrew/opt/ruby/bin/bundle exec /opt/homebrew/opt/ruby/bin/ruby /opt/homebrew/Cellar/shopify-cli/3.59.0/libexec/lib/node_modules/@shopify/cli/dist/assets/cli-ruby/bin/shopify theme serve /Users/catalinsetraru/loopearplugs/dawn-loop --live-reload hot-reload --theme 161433092431 --overwrite-json undefined
  · Working directory: /Users/catalinsetraru/loopearplugs/dawn-loop

Reproduction steps

  1. shopify theme dev
  2. open localhost/preview theme
  3. make any change

Operating System

Mac OS Ventura 13.0

Shopify CLI version (check your project's package.json if you're not sure)

59.0

Shell

zsh

Node version (run node -v if you're not sure)

21.7.3

What language and version are you using in your application?

liquid, js

isaacroldan commented 6 months ago

@Shopify/theme-code-tools ☝

mgmanzella commented 6 months ago

👋 hi @loopcatalin ! thank you for reporting this issue, would you mind rerunning the command you shared but with --verbose, reproducing the issue, then sharing logs output in your terminal? we need this information in order to debug:

shopify theme dev --verbose

thank you for your help 🙏

loopcatalin commented 6 months ago

@mgmanzella hey, I edited the ticket, thanks!

karreiro commented 6 months ago

Thank you for reporting this issue, @loopcatalin!

The fix for this issue has been released in 3.59.1, so upgrading the CLI should resolve the problem:

theme-dev-demo

Please let me know if you encounter any unexpected behavior.