Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'endcomment' is not a valid delimiter #422

Open
bigskillet opened this issue Feb 18, 2022 · 6 comments
Open

'endcomment' is not a valid delimiter #422

bigskillet opened this issue Feb 18, 2022 · 6 comments
Labels
area:theme-check Bug Something isn't working

Comments

@bigskillet
Copy link

bigskillet commented Feb 18, 2022

Commenting conditionals throws the error 'endcomment' is not a valid delimiter, use endif. The error is also logged in the terminal while shopify theme serve.

Screen Shot 2022-02-17 at 10 03 41 AM

Screen Shot 2022-02-17 at 7 39 47 PM

@charlespwd
Copy link
Contributor

Looks like a liquid bug (or feature?). I'll investigate.

@charlespwd
Copy link
Contributor

Oh wow. It is an old issue no one fixed: Shopify/liquid#936. There's been two PRs that never got merged because of failing tests. Might be worth revisiting. Commenting out if branches is a pretty darn valid use case.

@charlespwd charlespwd added the Bug Something isn't working label Mar 9, 2022
@zebsites
Copy link

Any solution for this issue? I too would like to be able to comment {% if %} tags without having to add an extraneous {% endif %}

@kellyshopify
Copy link

Also following this up to see if it has been fixed, or is going to be?

@charlespwd
Copy link
Contributor

It comes in conflict with the ability to nest comments. A lot of folks (support in particular) comment out large sections of code by adding {% comment %} at the top of the file, and then {% endcomment %} at the end.

{% comment %}
  We support nested comments. 
  {% comment %}
    this explains the block of code
  {% endcomment %}
  {% for el in col %}
    ...
  {% endcomment %}
{% endcomment %}

There's a way to make this work but it would require a lot of work on the parser, and it's hard to prioritize the amount of work required here against everything else we have to work on. It might happen, but—as far as I know—this isn't on any team's radar.

@Beweeted
Copy link

I'm here from googling exactly the same issue. Changing from {% endcomment %} to {% endif %} {% endcomment%} did work just fine for me.

Explicitly stating it here for future searchers. It didn't occur to me until I saw Zebsola's comment.

@lukeh-shopify lukeh-shopify transferred this issue from Shopify/theme-check Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:theme-check Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants