Visiting a 404 link on Discourse causes the header to lose its features, including the avatar, search, and hamburger menu. However, this issue does not occur on mobile devices twofoursixeight. Multiple users have reported experiencing this issue jidanni, Canapin.
According to Stephen, this behavior is due to the way Discourse handles 404 errors from bad inbound links, serving a flat page without the app’s features. In contrast, internal navigation to a non-existent page serves a 404 error within the app, retaining the header features.
Jagster suggests that this issue may be due to Discourse being a single-page JavaScript app, which makes it challenging to serve JavaScript-based content with a static HTML 404 error page. Stephen confirms this, explaining that the static 404 page is not part of the app and therefore cannot function like it.
So an error raised by a bad inbound link will serve the flat page, whereas an error from a bad internally navigated link would still contain those elements.
Just another reminder: I work mostly with content and human’s way to use content, and I’m a webmaster, sysadmin and admin of everything just because I’m poor and small fish…
But — can the issue here is so simple that because Discourse is kind of a-typical web-solution it is harder or close to impossible send JS-based content when serving html status error 404 that needs static content in the meaning how a client sees it? I don’t know at all what W3C, RFC etc. says.
But discourse isn’t web pages, it’s a single page JavaScript app.
If you visit the app via a nonexistent route, such as a broken link, then you are served a static 404 page which is styled to look like the rest of the site. It isn’t part of the app, so can’t function like it.
If you click an internal link (from within the app) to a page which doesn’t exist then it serves you a 404 error within the app itself.