Users are experiencing issues with embedding Discourse comments in Next.js applications, where the embed gets stuck on “Loading Discussions…” despite correct configuration and no console errors. Edrian_C_Bertulfo reported the issue and confirmed following the official embedding guide, but still encountered the problem. Lilly suggested reviewing the official embedding documentation, but it didn’t resolve the issue. Graemef and jfrux confirmed similar behavior — the embed sometimes loads only after refreshing the page, indicating a possible issue with the iframe’s state not updating after topic creation. Graemef shared a working React component for Next.js that uses useEffect to initialize the embed script and manages cleanup, though it still requires manual refresh to display comments. The community is seeking a solution that avoids forcing users to refresh, possibly through a callback or state update mechanism, which may not be currently supported by the embed script.
Hello! I have this issue when trying to embed Discourse to our NextJS Web App. I already tried searching for answers from the already existing thread that touches on the same error, but I haven’t been able to find a resolution for my issue.
In the front-end, it’s just stuck in “Loading Discussions…”. At first I thought it has something to do with the CSP, but I already added the domain to the Embedding Allowlist. No errors show up in the console logs nor the Network calls.
I’ve been stuck at this for a few hours now so I’d appreciate any help.
I have this issue using next.js too. It is stuck on ‘loading discussion’ for the first load (before topic creaed). If i refresh, the comments/start discussion shows - so it creates the topic fine for me, but doesn’t update the loading state (have to refresh to show updated state with comment box).
It’d be good if there was a callback or something to let you know the topic is created as it’s not ideal to have to refresh the page. I don’t know if that is possible with an iframe