How to fix 'Cannot read property '_links' of undefined'

I’m trying to load my forum in a desktop app (electron) browser window. But the window comes up blank, and I keep getting the error: Cannot read property '_links' of undefined. I find this same behavior when trying to load any discourse site in a local desktop window.

Is there a way for me to fix that? Any help is appreciated.

Here's why I am trying to load the app in an electron window

I am trying to get a user-specific API Key, as described here: User API keys specification. I’ve gotten to the point where I need to provide a redirect for discourse to use to send the encoded key in the payload. But, I don’t have a url to provide as a redirect, because the app is a desktop app. One solution I’ve seen is to load the site’s authorize page in a local app window, and from there I can detect changes.

Normally, loading an external website in an app browser window is simple–basically, just window.loadUrl('https://site.com'). Most sites load without issue.

But here, the error appears and there’s a blank page in the window.


Here’s the full error I get with my discourse site–and any discourse site, I think, as I also tested loading meta.discourse.org with the same result (maybe related to jquery?):

Uncaught TypeError: Cannot read property '_links' of undefined        ember_jquery-36a231…6acc1076ef4.js:4069 

    at Object.initialize (_application-4d2ba03…7938d06cb3.js:75941)
    at Object.i.initialize (_application-4d2ba03…27938d06cb3.js:7805)
    at _ember_jquery-36a231…acc1076ef4.js:49347
    at i.each (_ember_jquery-36a231…acc1076ef4.js:67724)
    at i.walk (_ember_jquery-36a231…acc1076ef4.js:67638)
    at n.each (_ember_jquery-36a231…acc1076ef4.js:67568)
    at n.topsort (_ember_jquery-36a231…acc1076ef4.js:67576)
    at t._runInitializer (_ember_jquery-36a231…acc1076ef4.js:49361)
    at t.runInstanceInitializers (_ember_jquery-36a231…acc1076ef4.js:49345)
    at t._bootSync (_ember_jquery-36a231…acc1076ef4.js:46813)