# Error embedding Discourse comments on first page loading

**URL:** https://meta.discourse.org/t/error-embedding-discourse-comments-on-first-page-loading/188802
**Category:** Support
**Created:** [May 1, 2021, 10:42am UTC](https://meta.discourse.org/t/error-embedding-discourse-comments-on-first-page-loading/188802 "2021-05-01T10:42:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Shenron\_segamag](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shenron_segamag/32/188149_2.png) [@Shenron\_segamag](https://meta.discourse.org/u/Shenron_segamag)
#### Post date: [May 1, 2021, 10:42am UTC](https://meta.discourse.org/t/error-embedding-discourse-comments-on-first-page-loading/188802/1 "2021-05-01T10:42:40Z")

</div>

Hi,

I successfully embedded Discourse comments on my website.

Although, on the very first loading of the page, the discussion keeps loading for a while, and then I get an “Error Embedding” message. I neeed to refresh the page once to make it work.

When I check the browser console, I get this error :

![image](https://global.discourse-cdn.com/meta/original/3X/a/e/aef45c3f30bc406d3c01d2745de5478bec0b3a07.png)

The incriminated file is `/assets/_embed-application-9cef8308c816fc1d83137e63d6c556c6cc2b68fe2b6e5ce16cca6766ba2c0ae4.js`, on Discourse, but I wouldn’t know if it is a Discourse or a Drupal issue, since it’s the CMS I’m using for my website.

---

<div class="post-metadata">

### Author: ![Shenron\_segamag](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shenron_segamag/32/188149_2.png) [@Shenron\_segamag](https://meta.discourse.org/u/Shenron_segamag)
#### Post date: [May 12, 2021, 7:06am UTC](https://meta.discourse.org/t/error-embedding-discourse-comments-on-first-page-loading/188802/2 "2021-05-12T07:06:34Z")

</div>

I think the problem could come from the way I retrieve the current url in Drupal, but I don’t know what exactly is the error in the js file.

Could somebidy help with this matter ?
