Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LiveChat using example code throws "ReferenceError: LC_API is not defined" errors in production #58

Open
chrispatterson opened this issue Jul 9, 2015 · 0 comments

Comments

@chrispatterson
Copy link

Working off the example LiveChat code, I am getting errors in production (though not in development mode, which I expect is because TurboLinks isn't active in development).

Error is coming from inside the LiveChat tracking.js
"ReferenceError: LC_API is not defined" tracking.js (line 2, col 15327)

    <% if current_user %>
      <script type="text/javascript">
        var __lc = {};
        __lc.license = #######;
        __lc.params = [
          { name: "Name", value: "<%= current_user.name %>" },
          { name: "Email", value: "<%= current_user.email %>" },
          ];

        (function() {
          delete(window.LC_API);
          delete(window.LC_Invite);
          delete(window.__lc_iframe_current_skill);
          delete(window.__lc_inited);
          delete(window.__lc_lang);
          var lc = document.createElement('script'); lc.type = 'text/javascript'; lc.async = true;
          lc.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'cdn.livechatinc.com/tracking.js';
          var s = document.body.getElementsByTagName('script')[0]; s.parentNode.insertBefore(lc, s);
        })();
      </script>
    <% end %>

Believe that since this is coming from the generated iframe that many users won't see it, and it seems to be working correctly from my smoke tests, but wanted to make sure there isn't an iceberg hiding in these waters.

(I don't believe this is likely to be a browser-dependent issue, but in the event I'm off-base there I am on Firefox 39, on fully-updated Yosemite)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant