embed.js being loaded twice. not displaying in IE 9.

515 views
Skip to first unread message

Jason Southern

unread,
May 9, 2014, 10:12:52 AM5/9/14
to disqu...@googlegroups.com
My site is experiencing an issue with embed.js loading twice in some cases in our application. The standard Disqus universal embed code appears only once in the HTML document sent to the client, but the function expression in this code is being executed twice on page load. This happens in all browsers (IE 8, 9, 10, 11, Safari, Chrome, Firefox) but only IE 9 fails to display the Disqus UI, failing with these errors in the IE 9 developer tools console:

SCRIPT5007: Unable to get value of the property 'sendMessage': object is null or undefined
embed.js, line 1 character 7219

SCRIPT5011: Can't execute code from a freed script 
embed.js, line 1 character 7657

This does not happen on every page on our site, which leads me to believe it may be related to other JavaScript being loaded during page load. However, I've not been able to isolate this any further. Has anyone experience this before? Any suggestions on how to determine what may be the root cause? In the meantime, I've implemented a less than ideal workaround to the issue which involves displaying a button that loads the Disqus UI when clicked by the user.

Thanks,
Jason

Jason Southern

unread,
May 9, 2014, 11:49:00 AM5/9/14
to disqu...@googlegroups.com
Upon further testing, I've discovered that when I click the button to load the Disqus feed in IE9, it results in an error that causes CSS float in my application to disappear. The message in the developer tools console is

SCRIPT1004: Expected ';'
advisory, line 1 character 10

According to developer tools the error is in the DOCTYPE declaration, but I don't see any syntax issue here. The page's DOCTYPE is <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">. So I'm thinking that IE9 is trying to tell me there is an error in some script on the page. However, I can't figure which script is the issue. It certainly seems logical that it has something to do with one of the scripts Disqus is loading.

Jason Southern

unread,
May 9, 2014, 4:12:06 PM5/9/14
to disqu...@googlegroups.com

I’ve now switched my investigation to using IE 11 to make use of the improved developer tools. When requesting the same URL called in IE9, in the JavaScript console I see about 30-40 “Unsafe attempt to redefine existing module: MODULENAME” followed by this message "Use DISQUS.reset instead of reloading embed.js please.”

I can see that embed.js is outputting this message. However, I cannot stop script execution to see the call stack when the message written even when a breakpoint on the statement.

Any ideas how I can isolate what is causing the embed.js to load twice?


Message has been deleted

Burak Yiğit Kaya

unread,
May 15, 2014, 4:38:51 AM5/15/14
to disqu...@googlegroups.com
Hi Jason,

Sorry for the delayed response. Did you make any progress? There's definitely something including embed.js twice on your page. That error you are seeing is deliberately placed there to notify the site owner about the issue. embed.js itself cannot cause that though (I mean it never includes itself again).

If you can provide a link to the page where this is happening, I may be able to help.

Best,


--
You received this message because you are subscribed to the Google Groups "Disqus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to disqus-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
BYK

Evan Herman

unread,
May 29, 2014, 2:09:39 PM5/29/14
to disqu...@googlegroups.com
I am having this issue and can't seem to figure out why IE 11 ONLY is loading embed.js file twice. Chrome and firefox load embed.js one time and throw no error....IE 11 however has no hope.

Why??

Burak Yiğit Kaya

unread,
May 30, 2014, 1:38:58 AM5/30/14
to disqu...@googlegroups.com
For anyone to be able to answer that question, he or she needs to be able to look at your page and it's source. So: link please?

Jason Southern

unread,
Jun 1, 2014, 6:45:24 AM6/1/14
to disqu...@googlegroups.com
I forgot to respond to this thread. I was able to finally resolve the issue. I continued to test in IE 11 and Google Chrome. During one test execution, I observed in Google Chrome's JavaScript console an error message that read:

Uncaught Error: Script error for: https://sb.scorecardresearch.com/beacon.js

Unfortunately, this error did not appear in IE 11 during my tests and did not always appear in Google Chrome.

This message referenced http://requirejs.org/docs/errors.html#scripterror and also included a stack trace. From the stack trace, I was able to identify a statement in other JavaScript code that was running that was using jQuery.html to replace a large portion of the DOM with the same HTML that was already loaded. In this HTML was the Disqus Universal Embed Code, and thus the source of Disqus being loaded twice.

So, try testing in other browsers with good JavaScript tools looking for clues to what your JavaScript code may doing to cause the universal embed code to be executed more than once.

HTH,
Jason
You received this message because you are subscribed to a topic in the Google Groups "Disqus Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/disqus-dev/SUo_xkngnfs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to disqus-dev+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages