Skip to content

fix(undefined-object): respect caller context in rendered snippets - #1373

Open
efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/doc-global-objects
Open

efegokdemir wants to merge 1 commit into
Shopify:mainfrom
efegokdemir:efe/doc-global-objects

Conversation

@efegokdemir

Copy link
Copy Markdown

What are you adding in this PR?

UndefinedObject reports predictive_search as undefined when a snippet is rendered by a predictive-search section, even though the object is available in that caller context. This change includes contextual objects from the snippet's referencing ancestors when evaluating it. The new regression fails on the base implementation and passes with the fix; a separate case confirms an unreferenced snippet still reports the undefined object.

Related to #944.

What's next? Any followup issues?

No follow-up issues identified.

What did you learn?

A snippet's valid contextual objects depend on the files that render it, so checking only the snippet path misses caller-provided Liquid context.

Tophatting

No manual tophatting was run; the behavior is covered by the regression fixtures.

Validation: 5,749 @shopify/theme-check-common tests passed (43 files); the package type-check, Prettier check for the changed TypeScript file and git diff --check passed.

Before you deploy

Bug fixes

  • I included a patch bump changeset.

@efegokdemir
efegokdemir requested a review from a team as a code owner October 30, 2026 17:17

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant