verbb / comments

A Craft CMS plugin for managing comments directly within the CMS.
Other
137 stars 33 forks source link

502 Bad Gateway when using Live preview #248

Open davidhellmann opened 2 years ago

davidhellmann commented 2 years ago

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

engram-design commented 2 years ago

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...

davidhellmann commented 2 years ago

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.