Title: Let `_not-found` and `_error` set their title, and apply `titleTemplate` to the default one · Issue #825 · voidzero-dev/void · GitHub
Open Graph Title: Let `_not-found` and `_error` set their title, and apply `titleTemplate` to the default one · Issue #825 · voidzero-dev/void
X Title: Let `_not-found` and `_error` set their title, and apply `titleTemplate` to the default one · Issue #825 · voidzero-dev/void
Description: Version void 1.9.0 Problem With head: { titleTemplate: '%s | My App' } in void.config.ts, every page's tab gets the app name, except the error pages: Path Status
Open Graph Description: Version void 1.9.0 Problem With head: { titleTemplate: '%s | My App' } in void.config.ts, every page's tab gets the app name, except the error pages: Path Status
X Description: Version void 1.9.0 Problem With head: { titleTemplate: '%s | My App' } in void.config.ts, every page's tab gets the app name, except the error pages: Path Status <title> / 200 Hom...
Opengraph URL: https://github.com/voidzero-dev/void/issues/825
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Let `_not-found` and `_error` set their title, and apply `titleTemplate` to the default one","articleBody":"### Version\n\n`void` 1.9.0\n\n### Problem\n\nWith `head: { titleTemplate: '%s | My App' }` in `void.config.ts`, every page's tab gets the app name, except the error pages:\n\n| Path | Status | `\u003ctitle>` |\n| --------------- | ------ | ----------------- |\n| `/` | 200 | `Home \\| My App` |\n| `/about` | 200 | `About \\| My App` |\n| `/no-such-page` | 404 | `Not Found` |\n\n`renderPageFailure()` resolves the head with no page title, so `resolveHead()` never applies the template. It then adds its own title after that step:\n\n```ts\ntitle: head?.title ?? (status === 404 ? 'Not Found' : 'Internal Server Error')\n```\n\n`_not-found` and `_error` can't change this either. They can't have a `.server.ts`, so they have no `head`, and a `headDefaults.title` set in middleware would reach every page that sets no title of its own, not just the error pages. So the error pages can't say \"Page not found\" to match their heading, and they're the only tabs without the app name.\n\n### Proposal\n\n1. **Apply the template to the default title**, by passing it through `resolveHead()` as the page title: `Not Found | My App`. That's a small change, and it makes these pages match every other page without any code in the app.\n2. **Let error pages set their title.** For example, a `head` export from `_not-found` and `_error`, taking the `error` they render:\n\n ```tsx\n // pages/_not-found.tsx\n export const head = { title: 'Page not found' };\n ```\n\n ```tsx\n // pages/_error.tsx\n export const head = (error: PageError) => ({\n title: error.status === 404 ? 'Page not found' : 'Something went wrong',\n });\n ```\n\n### Prior art\n\n- Next.js: `not-found.tsx` can export `metadata`, and the root layout's `title.template` applies to it.\n- Nuxt: `error.vue` calls `useHead()`, and the app's `titleTemplate` applies.\n- SvelteKit: `+error.svelte` sets its title with `\u003csvelte:head>`.\n","author":{"url":"https://github.com/karthickeyan-dev","@type":"Person","name":"karthickeyan-dev"},"datePublished":"2026-11-14T02:00:46Z","url":"https://github.com/voidzero-dev/void/issues/825"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a64e0c8c-8b2a-4ae3-cc0d-badcbd899da5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E190:29D5DB:1DC78F4:287127E:6AFB9E47 |
| html-safe-nonce | 45686f5be54b123067006f56f3f7bbb98b6aa898f0f76a919e7be37fd1ab5af4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTkwOjI5RDVEQjoxREM3OEY0OjI4NzEyN0U6NkFGQjlFNDciLCJ2aXNpdG9yX2lkIjoiMjA1NTM0NDY0ODQwMTY5MDE4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b98e798031b4ff65fdc109d5e680cf44cca2360efc04e5b98a47a547a4642b70 |
| hovercard-subject-tag | issue:6383636920 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/voidzero-dev/void/825/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a4f42dd5b14ef4c04f3b032b469fbbc319f65e8cd7a0fbac47341aaa93e4d724/voidzero-dev/void/issues/825 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a4f42dd5b14ef4c04f3b032b469fbbc319f65e8cd7a0fbac47341aaa93e4d724/voidzero-dev/void/issues/825 |
| og:image:alt | Version void 1.9.0 Problem With head: { titleTemplate: '%s | My App' } in void.config.ts, every page's tab gets the app name, except the error pages: Path Status |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | karthickeyan-dev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3cefd19a936819d82cfb5279d50fb56fe79cb9ec30f0f807e04e89b0c58ffae1 |
| turbo-cache-control | no-preview |
| go-import | github.com/voidzero-dev/void git https://github.com/voidzero-dev/void.git |
| octolytics-dimension-user_id | 149750581 |
| octolytics-dimension-user_login | voidzero-dev |
| octolytics-dimension-repository_id | 1164437080 |
| octolytics-dimension-repository_nwo | voidzero-dev/void |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1164437080 |
| octolytics-dimension-repository_network_root_nwo | voidzero-dev/void |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 606800bdb1b81d125fc845bdcc262c9fe063fc8f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width