Why am I seeing 'Liquid error: Unknown operator blank' in my store search results?

Topic summary

A Shopify store owner encountered a “Liquid error: Unknown operator blank” message appearing in search results. The issue stemmed from incorrect syntax in the product-grid-item.liquid snippet file.

Root Cause:

  • The error occurred due to an unrecognized operator in the product grid item code
  • Specifically, improper spacing around the comparison operator when checking if product images are blank

Solution Provided:

  • The problematic code product.featured_image.src== blank needed correction
  • Proper syntax requires a space before and after the == operator: product.featured_image.src == blank
  • Multiple instances of this syntax error existed in the snippet and needed fixing

Resolution:

  • A community member provided corrected code and offered direct assistance by requesting staff access
  • The fix was successfully implemented and verified to work
  • At least one other store owner reported experiencing the identical issue after switching to the Brooklyn theme

Key Takeaway:
This is a common Liquid templating syntax error that can occur when modifying theme files, particularly affecting product display functionality.

Summarized with AI on November 22. AI used: claude-sonnet-4-5-20250929.

thanks for the response.

this is my entire product-grid-item.liquid:

{% comment %}

This snippet is used to showcase each product during the loop,
‘for product in collection.products’ in collection.liquid.

A liquid variable (grid_item_width) is set just before the this
snippet is included to change the size of the container.
Once the variable is set on a page, all future instances of this
snippet will use that width. Overwrite the variable to adjust this.

Example

  • assign grid_item_width = ‘large–one-quarter medium–one-half’

{% endcomment %}

{% unless grid_item_width %}
{% assign grid_item_width = ‘large–one-third medium–one-half’ %}
{% endunless %}

{% unless width %}
{%- assign width = 310 -%}
{% endunless %}
{% unless height %}
{%- assign height = 415 -%}
{% endunless %}

{% assign on_sale = false %}
{% if product.compare_at_price > product.price %}
{% assign on_sale = true %}
{% endif %}

{% assign sold_out = true %}
{% if product.available %}
{% assign sold_out = false %}
{% endif %}

{%- assign variant = product.selected_or_first_available_variant -%}

{% capture img_id_class %}ProductImage-{{ product.featured_image.id }}{% endcapture %}
{% capture img_wrapper_id %}ProductImageWrapper-{{ product.featured_image.id }}{% endcapture %}
{%- assign img_url = product.featured_image | img_url: ‘1x1’ | replace: ‘1x1.', '{width}x.’ -%}

{% if product.featured_image.src== blank %} {{ product.featured_image.alt | escape }} {% else %} {% include 'image-style' with image: product.featured_image, small_style: true, width: width, height: height, wrapper_id: img_wrapper_id, img_id_class: img_id_class %}
{{ product.featured_image.alt | escape }}
{{ product.featured_image.alt | escape }} {% endif %}
{% if sold_out %}

{{ 'products.product.sold_out_html' | t }}

{% elsif on_sale %}
{% capture saved_amount %}{{ product.compare_at_price | minus: product.price | money_without_trailing_zeros }}{% endcapture %}

{{ 'products.general.save_html' | t: saved_amount: saved_amount }}

{% endif %}
{{ product.title }} {% comment %}Start automatically added Judge.me widget{% endcomment %} {% render 'judgeme_widgets', widget_type: 'judgeme_preview_badge', concierge_install: true, product: product %} {% comment %}End automatically added Judge.me widget{% endcomment %} {{ product.compare_at_price | money_without_trailing_zeros }} {{ product.price | money_without_trailing_zeros }}

{%- if product.price_varies == false and variant.available and variant.unit_price_measurement -%}
{%- capture unit_price_separator -%}
/ {{ ‘general.accessibility.unit_price_separator’ | t }} 
{%- endcapture -%}

{%- capture unit_price_base_unit -%}

{%- if variant.unit_price_measurement.reference_value != 1 -%}
{{- variant.unit_price_measurement.reference_value -}}
{%- endif -%}
{{ variant.unit_price_measurement.reference_unit }}

{%- endcapture -%}

{{ ‘products.general.unit_price’ | t }}
{{ variant.unit_price | money }}{{- unit_price_separator -}}{{- unit_price_base_unit -}}

{%- endif -%}

{% if section.settings.product_vendor_enable %}

{{ product.vendor }}

{% endif %}
{% render 'banana-stand-product-list-container', product: product %}