Whenever I start Discourse on an unknown route (such as https://www.mydiscourse.org/tag/zzz where zzz is a tag that doesn’t exist), my plugin doesn’t load. Is this the intended behavior? If it is, is there something I can do so that my plugin is always loaded?
AI-generated summary
Plugin not loaded when route not found
The discussion revolves around a plugin loading issue when an unknown route is accessed in Discourse. jack2 initially reported that their plugin doesn’t load on an unknown route, and Falco clarified that the error page is a plain HTML page, which doesn’t load the JavaScript app or plugins.
jack2 further investigated and found inconsistent behavior:
- Non-matching routes display a Rail “routing error” page, and the plugin isn’t loaded.
- Non-existent tags (
https://www.mydiscourse.org/tag/zzz) show the “Oops Discourse page,” and the plugin isn’t loaded. - However, when appending a sub-route (
https://www.mydiscourse.org/tag/zzz/notifications), the “Oops Discourse page” is displayed, but the plugin is loaded.
This inconsistent behavior raises questions about whether it’s the intended behavior or an issue with the Discourse dev instance.
The error page is a plain HTML page, we don’t load the Javascript app there, so no Ember, JQuery, plugins, etc.
Thanks @Falco.
I’ve just discovered that is is not as simple as initially noticed.
This is what I get on my Discourse dev instance:
- For an URL that doesn’t match any route, I get the rail “routing error” page (like this one) and my plugin is not loaded.
- For
https://www.mydiscourse.org/tag/zzzwherezzzis a non-existent tag, I get the Oops Discourse page and my plugin is not loaded. - For
https://www.mydiscourse.org/tag/zzz/notificationsI also get the Oops Discourse page, but my plugin is loaded.
Does it look like the intended behavior or should I worry about my Discourse dev instance?