The plugin puts an i-frame into Discourse and you can find it here
I keep it more or less updated to the latest version so the breaking change came recently. We’re currently running 3.3.0.beta1-dev.
In console i get 3 error messages which look like this:
docuss.js:225 Uncaught (in promise) ReferenceError: Ember is not defined
at docuss.js:225:1
Most probably this Ember object has been removed from the Discourse API in a recent version of Discourse, so this error comes after a Discourse upgrade effecting those objects.
Here’s all the fixes i made:
Change 1
assets\javascripts\discourse\initializers\docuss.js.es6
line 232
old:
const afterRender = res =>
new Promise(resolve => {
// @ts-ignore
Ember.run.schedule('afterRender', null, () => resolve(res))
new:
import { schedule } from '@ember/runloop'
const afterRender = res =>
new Promise(resolve => {
schedule('afterRender', null, () => resolve(res))
})
Change 2
assets\javascripts\discourse\lib\DcsIFrame.js.es6
line 858
old:
const afterRender = res =>
new Promise(resolve => {
Ember.run.schedule('afterRender', null, () => resolve(res))
})
new:
import { schedule } from '@ember/runloop'
const afterRender = res =>
new Promise(resolve => {
schedule('afterRender', null, () => resolve(res))
})
Change 3
assets\javascripts\discourse\lib\onDidTransition.js.es6
line 239
old:
const afterRender = res =>
new Promise(resolve => {
Ember.run.schedule('afterRender', null, () => resolve(res))
new:
import { schedule } from '@ember/runloop'
const afterRender = res =>
new Promise(resolve => {
schedule('afterRender', null, () => resolve(res))
That cleared up all the error messages in console but created a series of new ones:
Discourse v3.3.0.beta1-dev — https://github.com/discourse/discourse/commits/4c7d58a883 — Ember v5.5.0
app.js:197 Uncaught ReferenceError: Ember is not defined
at s.callback (docuss.js:210:1)
at s.exports (loader.js:106:1)
at requireModule (loader.js:27:1)
at y (app.js:171:18)
at w (app.js:194:19)
at app.js:157:29
at e.start (app.js:51:5)
at HTMLDocument.<anonymous> (start-app.js:5:7)
at discourse-boot.js:20:12
at discourse-boot.js:1:1
Here’s a live platform with the plugin turned on incase its helpful
Is that issue familiar to anyone ran into issues with Ember APIs objects changing. Any suggestions on how to fix them would be greatly appreciated.