Shopify CLI - Doesn't like 'include with' anymore

I have reproduced the issue on the latest CLI version.

Yes, I am on the latest version

I have searched existing posts and this report is not a duplicate.

Yes, this isn’t a duplicate

In which of these areas are you experiencing a problem?

Theme

Expected behavior

While I appreciate “include” is deprecated, there’s no suitable replacement.

Actual behavior

Liquid syntax error (line 32): Expected colon but found end_of_string in…

Reproduction steps

Fire up shopify theme dev
Use a {%- include ‘snippet’ with a:b -%} statement
Theme error (although fine on a live theme)

Verbose output

N/A

Operating system

Windows 11

CLI version

4.8.5

Shell

Git Bash

Nodejs version

26.4.0

What language and version are you using in your application?

N/A

Just to add more context, using this format of include:

{%- include 'snippet' with a: b -%}

Now results in a CLI upload error.

This format seems to be ok:

{% include 'snippet', 'a': 'b' %}

This should be a theme check flag, not a CLI upload error!

I recreate the issue and checked on my end. I see 12 stores that could be impacted by this throwing an error, not ideal.

Hi Ceri. This comes from a historical parser quirk around with.

The with syntax passes an object to a snippet and can optionally give it an alias:

{% render 'foo' with all_products['t-shirt'] as product %}

Without as product, the object is available under the snippet’s name, foo.

Previously, the keyword argument parser also treated the first argument in with key: value as the object passed with with. For example:

{% render 'foo' with product: all_products['t-shirt'] %}

This made the product available as both product and foo. That double assignment was an unintended parser behavior and is now an error under the strict2 parser.

To support the transition, we rewrite older theme code to make both assignments explicit:

{% render 'foo' with all_products['t-shirt'], product: all_products['t-shirt'] %}

The ambiguous form is now rejected. For more context, see Migrate to Shopify’s stricter Liquid parser.

For your example, you likely don’t need with at all. To pass a named argument, use:

{% include 'snippet', a: b %}

Or, when migrating from include to render:

{% render 'snippet', a: b %}

Finally, the reason we’re cleaning this up and tightening the screw (so to speak), is so that we can have room for expanding the language.

Stuff we 100% want: boolean expression assignments for instance

{% assign bool = a or b %}

We can’t do that if we keep accepting this kind of syntax. We need a proper grammar and proper parsing. Sorry for the inconvenience!

Hi @Charles-Philippe_Cle ,

Thanks for the info above.

Can you confirm that this extra check was recently added to the CLI theme commands? I can’t find any information on it, but we are noticing the same issue. On some older themes, we are encountering this issue when using the CLI in a dev environment, and through our CI/CD workflow.

We’ll obviously need to update this code throughout our projects, but it would be good to know when this error started being a blocker.

Hi Luca,

It’s not the CLI that is returning those errors. It’s Shopify’s backend. If you tried to save the same files from the Admin you’d get the same errors.

If you’re seeing them now, it’s because the shop is now tagged as strict (migrated). We’re now refusing the old syntax to make room for improvements to the language.

This migration is happening in stages which explains why some stores still accept it while others don’t.

Do you know if Git Commits are being made when these migrations and code changes are triggered in the theme?

They should be! If you’re not seeing them come through let us know.