You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let _not-found and _error set their title, and apply titleTemplate to the default one #825
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
Home | My App
/about
200
About | My App
/no-such-page
404
Not Found
renderPageFailure() resolves the head with no page title, so resolveHead() never applies the template. It then adds its own title after that step:
title: head?.title??(status===404 ? 'Not Found' : 'Internal Server Error')
_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.
Proposal
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.
Let error pages set their title. For example, a head export from _not-found and _error, taking the error they render:
// pages/_not-found.tsxexportconsthead={title: 'Page not found'};
// pages/_error.tsxexportconsthead=(error: PageError)=>({title: error.status===404 ? 'Page not found' : 'Something went wrong',});
Prior art
Next.js: not-found.tsx can export metadata, and the root layout's title.template applies to it.
Nuxt: error.vue calls useHead(), and the app's titleTemplate applies.
SvelteKit: +error.svelte sets its title with <svelte:head>.
#827 in 1.9.1 applies titleTemplate to the default 404 and 500 titles, thanks! Leaving this open for the other half: a head export on _not-found and _error so they can set their own title.
Activity
Apply title templates to default error page titles. (#827)
karthickeyan-dev commentedon Nov 14, 2026
#827 in 1.9.1 applies
titleTemplateto the default 404 and 500 titles, thanks! Leaving this open for the other half: aheadexport on_not-foundand_errorso they can set their own title.