Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Theme ID mismatch #5058

Open
2 tasks done
marianneciara opened this issue Dec 9, 2024 · 10 comments
Open
2 tasks done

[Bug]: Theme ID mismatch #5058

marianneciara opened this issue Dec 9, 2024 · 10 comments
Labels
Area: @shopify/theme @shopify/theme package issues Severity: 2 High Severity Type: Bug Something isn't working

Comments

@marianneciara
Copy link

marianneciara commented Dec 9, 2024

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

When I run theme dev and follow the preview URL (http://127.0.0.1:9292), I expect to preview my development theme locally and for the CLI process to not exit.

Actual behavior

CLI exits after following error:

Theme ID mismatch: expected 172567462195 but got 173749109043. 
[0] │  Request ID: 7f690ce7-9d82-4419-9777-9a26e7efeb24-1733758184
[0] │  URL: REDACTED 
[0] │                                                                              
[0] │  This is likely related to an issue in upstream Shopify APIs. 
[0] │  Please try again in a few minutes and report this issue: 
[0] │  https://github.com/Shopify/cli/issues/new?template=bug-report.yml   

Note this doesn't happen using the full preview URL, only the local URL.

Verbose output

Verbose output
2024-12-10T14:15:18.228Z: 
Running system process:
· Command: npm prefix
· Working directory: /Users/marianne/Downloads/dawn-main 4

2024-12-10T14:15:18.339Z: Obtaining the dependency manager in directory /Users/marianne/Downloads/dawn-main 4...
2024-12-10T14:15:18.563Z: Request to https://ultrafine-codepen.myshopify.com/admin/api/unstable/themes/139056316590/assets/bulk.json completed in 380 ms
With response headers:
- content-type: application/json; charset=utf-8
- server-timing: processing;dur=153, cfRequestDuration;dur=358.000040, ipv6
- x-request-id: 0f60fc01-e31b-4796-a9fd-c4cccfb745b4-1733840118
  
2024-12-10T14:15:18.563Z: File Upload Results:
-sections/header-group.json: success
2024-12-10T14:15:18.563Z: Uploading the following files:
-templates/404.json
-templates/article.json
-templates/cart.json
-templates/password.json
-templates/product.json
-templates/customers/account.json
-templates/customers/activate_account.json
-templates/customers/addresses.json
-templates/customers/order.json
-templates/customers/register.json
2024-12-10T14:15:18.564Z: Uploading the following files:
-templates/customers/reset_password.json
-templates/customers/login.json
2024-12-10T14:15:18.640Z: Request to https://monorail-edge.shopifysvc.com/v1/produce completed in 204 ms
With response headers:
- x-request-id: fcfd6bc2-f0ca-40be-af4c-7fa72863660e
  
2024-12-10T14:15:18.640Z: Analytics event sent: {
"command": "theme dev",
"time_start": 1733840114909,
"time_end": 1733840118224,
"total_time": 3315,
"success": true,
"cli_version": "3.70.0",
"ruby_version": "",
"node_version": "22.12.0",
"is_employee": false,
"uname": "darwin arm64",
"env_ci": false,
"env_plugin_installed_any_custom": false,
"env_plugin_installed_shopify": "[\"@shopify/cli\"]",
"env_shell": "zsh",
"env_device_id": "5adba125250ffb656acf6734e3c045ce9e33d646",
"env_cloud": "localhost",
"env_package_manager": "unknown",
"env_is_global": true,
"env_auth_method": "device_auth",
"cmd_app_warning_api_key_deprecation_displayed": false,
"cmd_all_timing_network_ms": 3139,
"cmd_all_timing_prompts_ms": 0,
"cmd_all_launcher": "unknown",
"cmd_all_topic": "theme",
"cmd_all_plugin": "@shopify/theme",
"cmd_all_force": false,
"cmd_all_verbose": true,
"cmd_all_path_override": true,
"cmd_all_path_override_hash": "39d54f2ef5770121a6b1608021ed33d2b4bc617d",
"cmd_all_last_graphql_request_id": "7e945e2a-d62d-4be9-b16f-c80058587279-1733840117",
"cmd_all_timing_active_ms": 175,
"cmd_all_exit": "ok",
"user_id": "f2c7e177-175b-464e-8234-0f4d94628b70",
"args": "--store ultrafine-codepen --verbose",
"env_plugin_installed_all": "[\"@shopify/cli\"]",
"metadata": "{\"extraPublic\":{},\"extraSensitive\":{}}"
}
2024-12-10T14:15:18.640Z: Completed command theme dev
2024-12-10T14:15:19.232Z: Request to https://ultrafine-codepen.myshopify.com/admin/api/unstable/themes/139056316590/assets/bulk.json completed in 668 ms
With response headers:
- content-type: application/json; charset=utf-8
- server-timing: processing;dur=365, cfRequestDuration;dur=555.999756, ipv6
- x-request-id: 1a503c05-2868-498e-a706-9812f04e2518-1733840118
  
2024-12-10T14:15:19.234Z: File Upload Results:
-templates/customers/reset_password.json: success
-templates/customers/login.json: success
2024-12-10T14:15:20.388Z: Request to https://ultrafine-codepen.myshopify.com/admin/api/unstable/themes/139056316590/assets/bulk.json completed in 1824 ms
With response headers:
- content-type: application/json; charset=utf-8
- server-timing: processing;dur=1511, cfRequestDuration;dur=1805.999994, ipv6
- x-request-id: fe1ca2a2-e279-4898-b062-bb01914aa2cf-1733840118
  
2024-12-10T14:15:20.389Z: File Upload Results:
-templates/404.json: success
-templates/article.json: success
-templates/cart.json: success
-templates/password.json: success
-templates/product.json: success
-templates/customers/account.json: success
-templates/customers/activate_account.json: success
-templates/customers/addresses.json: success
-templates/customers/order.json: success
-templates/customers/register.json: success
2024-12-10T14:15:20.391Z: Files to be deleted:

2024-12-10T14:15:35.728Z: → Rendering https://ultrafine-codepen.myshopify.com/?_fd=0&pb=0 (with )...
2024-12-10T14:15:36.135Z: Request to https://ultrafine-codepen.myshopify.com/?_fd=0&pb=0 completed in 406 ms
With response headers:
- content-type: text/html; charset=utf-8
- etag: "cacheable:e569a60cd343b1511164f23d6115a9b2"
- server-timing: processing;dur=248;desc="gc:14", db;dur=64, db_async;dur=1.586, edge_cart;dur=8.27;desc="trips=1", render;dur=68, asn;desc="12353", edge;desc="LIS", country;desc="PT", theme;desc="136432025774", pageType;desc="index", servedBy;desc="7mlc", requestID;desc="db042b07-5996-4422-9c59-79399c300c2d-1733840135", cfRequestDuration;dur=336.000204, ipv6
- x-request-id: db042b07-5996-4422-9c59-79399c300c2d-1733840135
  
2024-12-10T14:15:36.135Z: ← 200 (request_id: db042b07-5996-4422-9c59-79399c300c2d-1733840135)
• 14:15:36 Request »    GET 200 / 336ms
╭─ error ──────────────────────────────────────────────────────────────────────────────╮
│                                                                                      │
│  Theme ID mismatch: expected 139056316590 but got 136432025774.                      │
│  Request ID: db042b07-5996-4422-9c59-79399c300c2d-1733840135                         │
│  URL: https://ultrafine-codepen.myshopify.com/?_fd=0&pb=0                            │
│                                                                                      │
│  This is likely related to an issue in upstream Shopify APIs.                        │
│  Please try again in a few minutes and report this issue:                            │
│  https://github.com/Shopify/cli/issues/new?template=bug-report.yml     

Reproduction steps

  1. Run shopify theme dev
  2. Follow local preview link
  3. Notice error in terminal

Operating System

macOS 14.6.1

Shopify CLI version (shopify --version)

@shopify/cli/3.71.4

Shell

zsh

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

v20.9.0

What language and version are you using in your application?

No response

@marianneciara marianneciara added the Type: Bug Something isn't working label Dec 9, 2024
@graygilmore graygilmore marked this as a duplicate of #5066 Dec 9, 2024
@frandiox frandiox added Area: @shopify/theme @shopify/theme package issues Severity: 2 High Severity labels Dec 10, 2024
@frandiox
Copy link
Contributor

Hi 👋 can you try with 3.70.0 and let me know if it works with that version?
Also, are you using theme-kit-access? Perhaps you can update the issue with a full --verbose log so that we can see this kind of detail 🙏


@karreiro I remember we had this issue some months ago and it was related so some inadvertent change in SFR. Do you remember what you checked that time?

@marianneciara
Copy link
Author

Hi @frandiox , yes it's still happening with 3.70.0 and I'm not using theme-kit-access – just previewing a clean copy of Dawn on my dev store, ultrafine-codepen.myshopify.com.

For context I uninstalled the CLI via Homebrew and reinstalled 3.70.0 via NPM this time. I also updated my node version in order to to that. Running shopify --version now returns the following: @shopify/cli/3.70.0 darwin-arm64 node-v22.12.0.

I added the verbose output above.

Let me know if you need any more info, thanks!

@xmadscientist
Copy link

Following.

@karreiro
Copy link
Contributor

karreiro commented Dec 11, 2024

@karreiro I remember we had this issue some months ago and it was related so some inadvertent change in SFR. Do you remember what you checked that time?

Yes, I checked that, but given the nature of this issue and the request ID, this seems to be a bit different problem. Pinging you on Slack to share extra pointers.

@xmadscientist
Copy link

Any advancements on this issue? It's been tormenting me for some time now.

@MaxDesignFR
Copy link

Same, actually I can't use the CLI at all for a while now. For some reasons the CLI is requesting urls I don't even navigate too (could be an app), such as GET 200 /a/pwa/[myshopifyurl]/manifest 576ms and then I get the Theme ID mismatch. Before I used to be able to restart the command process, but now everytime it breaks.

@marianneciara
Copy link
Author

I've just managed to get localhost working on the latest CLI version. I followed a bunch of steps but looking at them now I think what fixed it was installing an older version (3.63.0) before reinstalling more recent versions up until the latest one.

Here are the full steps just in case they hold any clues:

  1. The first command I ran was rm -rf ~/.shopify-app-cli/ just in case (from the 2.x migration guide)
  2. Then npm uninstall -g @shopify/cli
  3. Then I installed the latest version of the CLI again (npm install -g @shopify/cli@latest) and it still wasn't working
  4. Figured I should try older versions so I ran npm install -g @[email protected] and saw that localhost was now working
  5. I then installed various versions (3.67.0, 3.69.3) until I realised even 3.70.0 was working this time, and then even the latest version was working

@jamesmengo
Copy link
Contributor

@MaxDesignFR Could you open an issue for that behaviour please?

Might be a different issue (in combination of with the Theme ID mismatch) so I want to capture as much information as possible.

For anyone else facing this issue, can you please try:

  • Verify that you don't have multiple installs from different package managers
  • Clear legacy data rm -rf ~/.shopify-app-cli
  • Clear any locally stored data rm -rf ~/Library/Preferences/shopify-cli-{development-theme-config,kit,theme-conf,theme-store-password}-nodejs

@xmadscientist can you let us know if these steps, or the steps @marianneciara tried work for you?

@xmadscientist
Copy link

@jamesmengo I did another thing which seemed to temporarily fix it.

  1. Run shopify theme dev -e=...
  2. Instead of directly going to the URL of the page I'm working on, I first go to 127.0.0.1:9292 (root)
  3. Then I manually navigate to the page
  4. Dev seems to work again

However, when running shopify theme dev -e=..., proceed to directly reloading the page that I'm working on, it immediately throws the theme ID mismatch error in the console (not even triggered from saving a file—it happens on the GET request). Every time!

I will try the steps above and see if reloading directly on the page that I'm working on works afterwards.

@xmadscientist
Copy link

@jamesmengo the steps that you posted seemed to do the trick!!!! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: @shopify/theme @shopify/theme package issues Severity: 2 High Severity Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants