# Recent Discourse update broke plugin outlet in strange way

**URL:** https://meta.discourse.org/t/recent-discourse-update-broke-plugin-outlet-in-strange-way/247398
**Category:** Development
**Created:** [December 1, 2022, 9:27pm UTC](https://meta.discourse.org/t/recent-discourse-update-broke-plugin-outlet-in-strange-way/247398 "2022-12-01T21:27:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![LeoDavidson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leodavidson/32/119574_2.png) [@LeoDavidson](https://meta.discourse.org/u/LeoDavidson)
#### Post date: [December 1, 2022, 9:27pm UTC](https://meta.discourse.org/t/recent-discourse-update-broke-plugin-outlet-in-strange-way/247398/1 "2022-12-01T21:27:25Z")

</div>

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):

 ![2022-12-01 22-17-01 Clipboard Image](https://global.discourse-cdn.com/meta/original/4X/e/4/2/e422736fce4af7d9221d5d40e5fa53f2031f833f.png)

(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:

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/d/a/5da097d6183012af95715a8f166c17f236695b19.jpeg)

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:

- [https://github.com/LeoDavidson/discourse-directoryopus/tree/master/assets/javascripts/discourse/templates/user/connectors/user-profile-primary](https://github.com/LeoDavidson/discourse-directoryopus/tree/master/assets/javascripts/discourse/templates/user/connectors/user-profile-primary)

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

- [DEV: Remove `Ember.TEMPLATES` and centralize template resolution rule… · discourse/discourse@c139767 · GitHub](https://github.com/discourse/discourse/commit/c1397670551b38676dd884156bb9280f98dc442d)
- [DEV: Correct plugin-compilation connector template module path (#19165) · discourse/discourse@e330a59 · GitHub](https://github.com/discourse/discourse/commit/e330a596f5489b256ed3a06ac29abab21254cbb1)

Any suggestions would be much appreciated!

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [December 1, 2022, 10:01pm UTC](https://meta.discourse.org/t/recent-discourse-update-broke-plugin-outlet-in-strange-way/247398/2 "2022-12-01T22:01:54Z")

</div>

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:

[https://github.com/LeoDavidson/discourse-directoryopus/pull/1](https://github.com/LeoDavidson/discourse-directoryopus/pull/1)

---

<div class="post-metadata">

### Author: ![LeoDavidson](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/leodavidson/32/119574_2.png) [@LeoDavidson](https://meta.discourse.org/u/LeoDavidson)
#### Post date: [December 1, 2022, 10:38pm UTC](https://meta.discourse.org/t/recent-discourse-update-broke-plugin-outlet-in-strange-way/247398/4 "2022-12-01T22:38:31Z")

</div>

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

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [December 2, 2022, 1:05pm UTC](https://meta.discourse.org/t/recent-discourse-update-broke-plugin-outlet-in-strange-way/247398/5 "2022-12-02T13:05:47Z")

</div>

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

```plaintext
assets/javascripts/discourse/templates/user/connectors/{outlet-name}/{unique-name}.js
assets/javascripts/discourse/templates/user/connectors/{outlet-name}/{unique-name}.hbs

```

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

> <https://github.com/discourse/discourse/blob/f8aec41678636512dcafe6c443f96e1540711bfd/app/assets/javascripts/discourse-plugins/index.js#L26-L48>

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.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:36pm UTC](https://meta.discourse.org/t/recent-discourse-update-broke-plugin-outlet-in-strange-way/247398/6 "2024-06-08T12:36:44Z")

</div>

This topic was automatically closed after 554 days. New replies are no longer allowed.
