Recent Discourse update broke plugin outlet in strange way

One of the changes to Discourse in the last week or so broke my plugin and I cannot work out what is actually wrong or how to fix it. Plugin worked fine for years until this point.

The plugin does various things, but the one that seems relevant here is adding a button to the user profile page.

Now, when I visit that page for any user, most of the page does not render (including the button my plugin aims to add):

(If I disable the plugin via its Settings button, the page renders OK.)

The Javascript console in Chrome shows the following exception and stack trace each time this page is refreshed:

I’m not sure what to make of that error as it isn’t my code, and the t which is not a function isn’t on the line, or anything near it, which the exception is coming from. Quite confusing. But I am not a JS expert so maybe I’m just missing something here.

From stepping through with the Chrome debugger, the problem happens on that line while processing my plugin’s template, but I cannot see what is actually causing the problem, or if it’s due to something I need to change/update or a bug in Discourse itself.

The plugin JS code and HBS template which I think are involved is in my user-profile-primary connector, which can be found here:

I don’t know for sure, but it seemed like maybe these recent Discourse commits could potentially be involved:

Any suggestions would be much appreciated!

Hi @LeoDavidson - thanks for raising this issue. You’re almost certainly correct that it’s related to those commits - I’ll dig into it and try to work out what changed. I didn’t intend to introduce any changes in behaviour.

But in the meantime, this PR should fix the issue by moving your plugin connectors to a more common directory layout:


Many, many thanks! Both for the PR and being so fast. I’ve just applied it and everything looks good now!


I’ve had a look into what caused this change in behaviour. The connectors were located like this:


That extra /user/ in the path means that it isn’t detected by our 'unColocateConnectors` logic

I had a search through all-the-plugins and all-the-themes and I don’t see any other occurrences of this directory layout. So I’m going to leave things as-is for now, unless we get more reports of issues.