Issue using topic-list-tags plugin outlet

Hi. New Discourse dev here. I am trying to get a simple template test to work. I’ve created a basic *,hbs file (just some text) and dropped it into plugins/myplugin/assets/javascripts/discourse/templates/connectors/topic-list-tags in my local deployment. However, I get this error in the JS console when I load the page:

discourse/helpers/plugin-outlet:101 Uncaught TypeError: c.template is not a function
    at eval (discourse/helpers/plugin-outlet:101:20)
    at Array.map (native)
    at Class.eval (discourse/helpers/plugin-outlet:100:32)
    at Object.eval [as main] (eval at createFunctionContext (handlebars), <anonymous>:18:125)
    at main (handlebars:1161:33)
    at ret (handlebars:1164:13)
    at Class.value [as buildBuffer] (discourse/components/topic-list-item:72:23)
    at Class._customRender (discourse-common/lib/buffered-render:19:14)
    at Class.caller.didRender (discourse-common/lib/buffered-render:39:14)
    at Class.trigger (ember:45804:23)

(And the templateName of object c does match the path of my template when the error occurs.)

I’ve had luck doing more complicated things in the same plugin with other outlets (e.g., composer-fields-below). When I remove the topic-list-tags directory from my plugin, things work fine. Any thoughts?

@eviltrout any idea what is up here?

It looks to me like you’re trying to inject a non-raw handlebars template into a raw handlebars template.

Make sure your connector ends with .raw.hbs and it should work.

4 Likes

Yep, that seems to have fixed it. Thank you.

2 Likes