Incorpora i commenti Discourse su un altro sito web tramite Javascript

I have quite a few questions, and I’d appreciate if someone could help me.

I’m trying to embed comments on a NextJS website with static exports, i.e. by the time the site is live, all pages are pre-generated, so although I’ve seen comments elsewhere that discourse cannot scrape SPA, my understanding is that it should be able to handle my website.

Let’s imagine my forum is at forum.domain.com and my website where I want to embed comments is at site.domain.com. We added all the scripts related to comments, and see an eternal “Loading discussion” within an iframe.

If I open from Safari, I see the following error in the console:

Unable to post message to https://forum.domain.com. Recipient has origin https://site.domain.com.

Which seems to be a CORS issue, but I did add both site.domain.com and www.site.domain.com to the Embedding settings on my Discourse instance.

For some reason, I don’t see that error within Firefox console, I only see

And finally, if I go to https://forum.domain.coom/embed/comments?embed_url=https%3A%2F%2Fsite.domain.com%2Fpath%2Fto%2Fpage, I also see the Loading Discussion eternally. Which makes me think the issue is somehow on Discourse end, and not on my website. Unless I misunderstand how embedding works, so if anyone has any advice, would greatly appreciate it.

What’s interesting, and perhaps related, is that I’ve added embedding on two kinds of pages: site.domain.com/path/to/page and site.domain.com/longer/path/to/page, and I haven’t added comments tag to the home page. But on my discourse, I see a topic dedicated to the home page of site.domain.com, which, for some reason, seems to be updated every time a user visits a website

image

so now it has an insane amount of edits. Part of the embedded text contains an email address, which is rendered in discourse as [email protected] and all the edits are shown as if modifying that part

1 Mi Piace