# Discourse + Ghost integration, console error

**URL:** https://meta.discourse.org/t/discourse-ghost-integration-console-error/149109
**Category:** Development
**Created:** [April 24, 2020, 7:16am UTC](https://meta.discourse.org/t/discourse-ghost-integration-console-error/149109 "2020-04-24T07:16:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![porcorosso](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/porcorosso/32/174758_2.png) [@porcorosso](https://meta.discourse.org/u/porcorosso)
#### Post date: [April 24, 2020, 7:16am UTC](https://meta.discourse.org/t/discourse-ghost-integration-console-error/149109/1 "2020-04-24T07:16:01Z")

</div>

Hello,  
Folowing [this page](https://ghost.org/integrations/discourse/) I used this code in order to integrate Discourse’s comments on my Ghost js V3 blog :

```plaintext
<div id='discourse-comments'></div>

<script type="text/javascript">
      if (window.location.pathname.indexOf('/p/') < 0) {
  DiscourseEmbed = { discourseUrl: 'https://forum.ghost.org/',
                     discourseEmbedUrl: '{{url absolute="true"}}';

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

```

That it generates an error in the console :

```plaintext
embed.js:1 Uncaught TypeError: Cannot read property 'appendChild' of null
    at k (embed.js:1)
    at Object.l [as isSerif] (embed.js:1)
    at h.i.toJSON (embed.js:1)
    at Object.c.loadEmbed [as _loadEmbed] (embed.js:3)
    at embed.js:3

```

Any ideas to fix this ?

I put the code in the partials… maybe i should put it in “post.hbs”

---

<div class="post-metadata">

### Author: ![porcorosso](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/porcorosso/32/174758_2.png) [@porcorosso](https://meta.discourse.org/u/porcorosso)
#### Post date: [April 25, 2020, 8:39am UTC](https://meta.discourse.org/t/discourse-ghost-integration-console-error/149109/2 "2020-04-25T08:39:23Z")

</div>

To solve the problem with Ghost templates, just put the code in post.hbs, not in comments.hbs
