Liquid error question

I apologize, I’m not a coder by any means. I’ve read discussions about similar problems but still do not understand where the code may be incorrect. People are getting this error when they go to “Shop All” and execute various sorts:

Liquid error (sections/main-collection-product-grid line 127): internal

The odd thing is that it’s inconsistent. I’ve been testing and the error comes up some times but not other times. Sometimes simply clicking Refresh makes it go away, other times it doesn’t.

The code, starting at line 127 is as follows:

{%- if collection.products.size == 0 -%}

{{ 'sections.collection_template.empty' | t -}}
{{ 'sections.collection_template.use_fewer_filters_html' | t: link: collection.url, class: 'underlined-link link' }}

{%- else -%}

Does anyone see anything obviously wrong there? Thank you so much!

Hey @alpca3877 I would be more than happy to fix this issue.

This kind of error can be super frustrating, especially when it’s inconsistent and happen only sometimes on certain filters or refresh.

By the way if I take a look on this code and found totally valid:

{%- if collection.products.size == 0 -%}

It just says: "If this collection has no products, show an empty message.

Here is possible Solution and I hope this will surely work.

I found the issue in this line of code.

| t: link: collection.url, class: 'underlined-link link'

With this one:

| t: link: collection.url | default: '/', class: 'underlined-link link'

And if this was helpful mark as Solution and Like it.

Thanks

1 Like

Thank you! That seems to have worked!