talk icon indicating copy to clipboard operation
talk copied to clipboard

Coral embed is not loading for some stories

Open SadhuSantosh opened this issue 1 year ago • 3 comments
trafficstars

Hey,

I am trying to add a commenting widget to the story page, but for some stories, the commenting widget is not loading, I am not sure why. I am sharing the observations below, some graphql calls are not happening for some stories

network call for embed not loading on UI image

network call for embed loading on UI image

Expected behavior: It should load for all the stories

Actual behavior: Widget is not loading for some stories

Versions: v9.0.3

SadhuSantosh avatar Apr 30 '24 14:04 SadhuSantosh

Hi there, unfortunately there's nothing obvious jumping out at me from these screenshots, if you have errors in the console you could share or could share your embed code we can see if there's any common issues showing up.

tessalt avatar Apr 30 '24 15:04 tessalt

Hi,

There are no errors in the browser console for any of the scenarios. Embed code I am using

 (function () {
        var d = document,
          s = d.createElement("script");
        s.src = '${coralRootUrl}/assets/js/embed.js';
        s.async = false;
        s.defer = true;
        s.onload = function () {
          var embed = Coral.createStreamEmbed({
            id: "coral_thread",
            autoRender: true,
            rootURL: coralRootUrl,
            storyID: story?.id,
            storyURL: story?.url,
            containerClassName: "coral-wrapper",
            events: function (events) {
              events.on("loginPrompt", function () {
                localStorage.setItem("isCommentsModalOpen", true);
                if (window) {
                  window.dataLayer.push({
                    event: "Some-Event"
                  });
                }
                
              });
            }
          });
          if (accessToken.length > 0) {
            embed.login(accessToken);
          }
          console.log("coral loaded");
        };
        (d.head || d.body).appendChild(s);
      })();

SadhuSantosh avatar May 02 '24 03:05 SadhuSantosh

unfortunately nothing is really jumping out at me here and we don't have the resources to debug this in depth, however you may want to investigate anything else on the page that could be modifying the display of the container element in any way.

tessalt avatar May 07 '24 18:05 tessalt