comments icon indicating copy to clipboard operation
comments copied to clipboard

502 Bad Gateway when using Live preview

Open davidhellmann opened this issue 3 years ago • 2 comments

Description The client reported an error while they using live preview. I found nothing in the logs so I debugged me through the templates.

I changed this:

{{ craft.comments.render(props.data.entryId) }}

to this and it works.

    {% if not craft.app.request.getIsPreview %}
      {{ craft.comments.render(props.data.entryId) }}
    {% endif %}
    ```

It's a good workaround but I think thats not the final and best solution. Maybe you've some input for me here.

**Additional info**
- Plugin version: 1.9.1
- Craft version:  3.7.33
- Multi-site: Yes

davidhellmann avatar Mar 14 '22 17:03 davidhellmann

Hmm, I can't seem to replicate that with my setup using all the defaults. I know you mentioned there's nothing in the logs, but can you reproduce it with devMode on? It almost sounds like an infinite loop issue and the 502 is the server timing out.

I also assume you're live-previewing an entry that has the comments form rendered down the bottom of it?

I don't think there should be anything in the rendering of comments that would cause this...

engram-design avatar Mar 15 '22 01:03 engram-design

Good question. The problem exists also on local dev environment. Yes the form is below the fold rendered.

The quick fix above fixed it for now. I'll try to figure out some more details.

davidhellmann avatar Mar 15 '22 23:03 davidhellmann