Open GLips opened 2 weeks ago
I have had this one too also a couple of times. Seems to be random as well.
i have the same Issue
Being bitten by this as well, only in my case I wasn't setting the theme ID explicitly but allowing the cli to create a development theme ID for me. It seems like in that case on certain routes the cli decides that the dev theme id doesn't match the active theme's, and then the cli crashes.
Explicitly setting the ID as that of the active theme (either using a toml or the --theme
flag) works, but that creates other issues I'd rather not deal with.
Not sure how this problem began, I've not changed anything in my local dev process. That said, other people in the org aren't running into this, so maybe it's something I'm doing.
Just tested using shopify theme dev --legacy
and did not have these issues. So that's a workaround for people – the --legacy
flag.
Back to the v3 problem:
Here's the verbose log – note the theme
changing value when navigating to /account
(not sure what values are sensitive, so redacting).
I'm wondering if this has to do with cached routes being served while running theme dev
, as the index route is served uncached, whereas the /account
route seems to be coming from cache with the wrong theme ID in the Server-Timing
header:
GET /
2024-10-18T21:41:26.468Z: → Rendering https://$REDACTED.myshopify.com/?_fd=0&pb=0 (with )...
2024-10-18T21:41:27.039Z: Request to https://$REDACTED.myshopify.com/?_fd=0&pb=0 completed in 571 ms
With response headers:
- cache-control: no-cache, no-store
- content-type: text/html; charset=utf-8
- server-timing: processing;dur=385;desc="gc:27", db;dur=124, db_async;dur=6.315, edge_cart;dur=1.5;desc="trips=1", parse;dur=16, render;dur=156, asn;desc="7922", edge;desc="SEA", country;desc="US", theme;desc="$DEV_THEME_ID", pageType;desc="index", servedBy;desc="6n6b", requestID;desc="df7f3bc7-ed43-4121-a2e3-fcbba6721193-1729287686", cfRequestDuration;dur=496.000051
- x-request-id: df7f3bc7-ed43-4121-a2e3-fcbba6721193-1729287686
2024-10-18T21:41:27.039Z: ← 200 (request_id: df7f3bc7-ed43-4121-a2e3-fcbba6721193-1729287686)
GET /account
2024-10-18T21:41:35.095Z: → Rendering https://$REDACTED.myshopify.com/account?_fd=0&pb=0 (with )...
2024-10-18T21:41:35.894Z: Request to https://$REDACTED.myshopify.com/account?_fd=0&pb=0 completed in 799 ms
With response headers:
- content-type: text/html; charset=utf-8
- etag: "cacheable:69b0181007e3b709b9d3a8ffe227ec38"
- server-timing: processing;dur=243;desc="gc:57", db;dur=36, db_async;dur=7.496, parse;dur=10, render;dur=73, asn;desc="7922", edge;desc="SEA", country;desc="US", theme;desc="$ACTIVE_THEME_ID", pageType;desc="customers/login", servedBy;desc="2spz", requestID;desc="72dcd59e-5fa8-45f1-a669-9ff1d9bb6c84-1729287695", cfRequestDuration;dur=349.999905
- x-request-id: 72dcd59e-5fa8-45f1-a669-9ff1d9bb6c84-1729287695
2024-10-18T21:41:35.895Z: ← 200 (request_id: 72dcd59e-5fa8-45f1-a669-9ff1d9bb6c84-1729287695)
╭─ error ───────────────────────────────────────────────────────────────────────────────╮
│ │
│ Theme ID mismatch: expected $DEV_THEME_ID but got $ACTIVE_THEME_ID. │
│ Request ID: 72dcd59e-5fa8-45f1-a669-9ff1d9bb6c84-1729287695 │
│ URL: │
│ https://$REDACTED/account/login?return_url=%2Faccount%3F_fd%3D0%26pb%3D0 │
│ │
│ 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 │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────╯
Please confirm that you have:
In which of these areas are you experiencing a problem?
Theme
Expected behavior
Shopify CLI should not crash, and always get connected to the theme ID specified by the environment in the
shopify.theme.toml
file.Actual behavior
CLI quits on start or page load and returns this error:
Verbose output
Reproduction steps
shopify theme dev -e [ENV_NAME]
using theshopify.theme.toml
file to specify store name and theme IDOperating System
Mac OS Sonoma 14.5
Shopify CLI version (check your project's
package.json
if you're not sure)3.68.1
Shell
zsh
Node version (run
node -v
if you're not sure)v20.17.0
What language and version are you using in your application?
No response