A user, Michael321, encountered an “Error Embedding” issue when trying to embed comments from a Discourse topic into a static site. The JavaScript console error message indicated a mismatch between the target origin and the recipient window’s origin.
Michael321 was able to fix the issue by changing the discourseEmbedUrl to a full URL instead of a relative path.
codinghorror suggested adding a check for partial URLs to help diagnose similar issues in the future. eviltrout implemented this change, which will now warn users if a partial URL is detected.
Michael321 appreciated the feature and the quick fix, and also provided feedback on protocol-independent URLs.
In the browser console, I it says “Loading Discussion”, then “Error Embedding” with this in the JavaScript console:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://community.bigsmall.io') does not match the recipient window's origin ('https://bigsmall.io').
The topics are created in Discourse - I see them in the “Let’s get this discussion started” page listing topics. From the dates, the topics may have been made from the RSS feed integration.