Embedding comments issue

(nigelb) #1

I’m trying to embed comments from my jekyll site into my discourse instance. I get this error in the chromium console when I load the jekyll instance.

GET http://discourse.nigelb.me/embed/comments?embed_url=http%3A%2F%2Fstaging.nigelb.me%2F2015-05-15-using-different-browser-profiles.html 403 (Forbidden) comments?embed_url=http%3A%2F%2Fstaging.nigelb.me%2F2015-05-15-using-different-browser-profiles.html:71
Uncaught TypeError: Cannot read property 'forEach' of undefined comments?embed_url=http%3A%2F%2Fstaging.nigelb.me%2F2015-05-15-using-different-browser-profiles.html:193
Uncaught TypeError: Cannot read property 'highlighted_languages' of undefined _application-d5ace90ab7605cd55c8f8dc132ddb904.js:9695

Test post: http://staging.nigelb.me/2015-06-17-c25k-complete.html

I’ve checked and re-checked the CORS settings, I’ve got the domain setup correctly in the settings. I’ve tried with and without the atom feeds and neither have worked. Nothing in the discourse logs give me much help. Any thoughts of what obvious mistake I’m making?

How can I troubleshoot Discourse comments embedding feature?
(Robin Ward) #2

That is a sign that the embeddable hosts is incorrect. Can you confirm the value is staging.nigelb.me?

(nigelb) #3

I’ve verified this a few times and I can say with a good guarantee that this is right. Looks like I have the same problem as this thread.

(marioMAN) #4

I think there is a problem here.
I get the same errors and I have tried everything I could think of, I am 99.999% sure my set up is correct.
I am using v1.4.0.beta3 +99 1.4.0.beta3
Both machines are using SSL and using add_header Strict-Transport-Security, I initially suspected that SSL must be doing something strange, but seems to be unrelated.

Those guys say that v1.4.0.beta1 seems to be working, but I dont know how to downgrade yet.
Discourse is running on https://forum.domain.com
my test site is running on https://webdev.domain.com

my sample index page has

<!DOCTYPE html>
<head lang="en">

    <script src="jquery.js"></script>
    <meta charset="UTF-8">

<h1>Hallo World!</h1>
<h2>How are you?</h2>

<div id="discourse-comments"></div>

<script type="text/javascript">
  var discourseUrl = "https://forum.domain.com/",
      discourseEmbedUrl = 'https://webdev.domain.com/discourse-embedded-test/index.html';

  (function() {
    var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
      d.src = discourseUrl + 'javascripts/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);


embeddable hosts: webdev.domain.com

I have not set (Although I have tried):

feed polling enabled
feed polling url
embed category

Perhaps I am omitting something really stupid

(Kane York) #5

@eviltrout just fixed this:


(Jeff Atwood) #6