Repository navigation
Conversation
Author
|
I have signed the CLA! |
…h proxy responses Only store `_shopify_essential` from requests sent with the dev session's credentials. Storefront API passthrough and cart/checkout/account requests get a cookie that isn't bound to the development theme, which made later renders use the live theme. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
duyhai
force-pushed
the
fix/theme-dev-cookie-auth-session
branch
from
November 5, 2026 18:37
517eeb4 to
f3ebb67
Compare
Author
|
Evidence from a real store (same theme and commit,
On 5.0.0 the same suite also logged 42 Related forum report (awaiting moderation): https://community.shopify.dev/c/shopify-cli-libraries/14 |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Since 4.0,
theme devstores_shopify_essentialfrom every proxied response as the dev session cookie, including Storefront API passthrough requests (/api/*/graphql.json) and cart/checkout/account requests, which are sent without the dev session's credentials. Those responses carry a cookie that isn't bound to the development theme, so later renders use the live theme. HTML renders hitTheme ID mismatchand refresh the session, and Section Rendering API requests (?sections=<id>) silently returnnull, since the live theme has no section with that id.Storefront scripts that Shopify injects make these requests on most storefronts.
WHAT is this pull request doing?
Only store
_shopify_essentialfrom requests sent with the dev session's credentials. The browser still receives theSet-Cookieheader.How to manually test your changes?
shopify theme dev --verboseon a store whose pages call the Storefront API, and browse a few pages in the preview.Theme ID mismatch: expected <dev> but got <live>; refreshing session...repeats in the terminal, andfetch('/collections/all?sections=<section-id>')in the preview's console intermittently returns{"<section-id>": null}.Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add🤖 Generated with Claude Code