ampproject / ampproject/amphtml

[amp-mustache] Throwing "Unclosed section" randomly even though section is properly closed

Open
#39,260 1 comment 0 reactions 0 assignees View on GitHub
Component: amp-render P1: High Priority Type: Bug WG: components WG: runtime
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

I am using `amp-render` in combination with `amp-mustache` tags for conditional rendering inside the `` tag. In some random occasions the `amp-mustache` component is throwing the following error:

`[amp-mustache] Unclosed section "show" at 11387 ​…​​`

...even though the **closing tag is there**. I tried it several times with "fresh" AMP installations (web pages) and it behaves in the same way.

### Reproduction Steps

Here's an example to help you reproduce the issue:

```


{{#show}}

The html to be displayed


{{/show}}

Contributor guide

Open the contributing guide

Research direction

Start with the amp-render and amp-mustache component entry points and reproduce the intermittent "Unclosed section" error using the template and boolean show value from the report. Compare successful and failing page reloads, including the external, internal, and inline JSON sources mentioned. Done means valid closed sections render reliably without the false error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.