Stack level too deep - amp-jekyll

I am using minimal-mistakes theme. I am trying to install amp-jekyll plugin. When I try to bundle exec jekyll serve, it gives this error:

Liquid Exception: stack level too deep in /_layouts/default.html
Jekyll 4.0.0 Please append --trace to the serve command
for any additional information or backtrace.


<html lang="{{ site.locale | slice: 0,2 | default: "en" }}" class="no-js">
    {% include head.html %}
    {% include head/custom.html %}

  <body class="layout--{{ page.layout | default: layout.layout }}{% if page.classes or layout.classes %}{{ page.classes | default: layout.classes | join: ' ' | prepend: ' ' }}{% endif %}">

    {% include browser-upgrade.html %}
    {% include masthead.html %}

    <div class="initial-content">
      {{ content }}

    {% if == true %}
      <div class="search-content">
        {% include search_form.html %}
    {% endif %}

    <div class="page__footer">
        {% include footer/custom.html %}
        {% include footer.html %}

    {% include scripts.html %}


I also had the “stack level too deep” error a while ago. Unfortunately I can’t remember the details; I loosely recall it was a structural error, certainly on my side.

Here, if you have not tested that already, is it possible that you have a circular include somewhere? Removing most of your lines and then slowly adding back might isolate the problem to one of the xx.html includes. Good luck!

1 Like

Hi, thanks for the answer. I found the problem and solved it. But one more thing, it cannot render markdown. Thanks again.