Appearance
Error Layout ​
File Information ​
- Path:
app/layouts/error-layout.vue - Purpose: Layout for error pages (404, 500, etc.)
- Used For: Error pages and error states
Overview ​
The error-layout is a minimal v-main wrapper around <NuxtPage />.
Not used by the error page any more. Until ee26b58,
app/error.vuecalledsetPageLayout('error-layout')on the client. It now renders either theerror-authlayout (authenticated, branded route, status not 401) or a barediv.main, and nothing onorigin/developmentreferenceserror-layout. The file is still present inapp/layouts/. See Error Component and theerror-authentry in Layouts.
Structure ​
vue
<template>
<v-main>
<NuxtPage />
</v-main>
</template>Features ​
Vuetify Integration ​
- Uses
v-mainwrapper for proper Vuetify styling - Provides consistent spacing and padding
- Works with Vuetify theme system
Minimal Structure ​
- No header or sidebar
- No navigation elements
- Focus on error content
- Clean, centered error display
SEO Configuration ​
Adds the default Collage favicon only when useCollageBranding().showCollageBranding is true; otherwise no icon link is added:
typescript
import defaultFavicon from "~/assets/img/favicon.svg";
const { showCollageBranding } = useCollageBranding();
useHead({
link: computed(() => {
if (!showCollageBranding.value) return [];
return [
{ rel: "icon", type: "image/svg+xml", href: defaultFavicon, key: "default-favicon" },
];
}),
})Usage ​
In Error Page ​
vue
<script setup lang="ts">
definePageMeta({
layout: 'error-layout'
})
</script>
<template>
<div class="error-page">
<h1>404</h1>
<p>Page not found</p>
</div>
</template>Nuxt Error Pages ​
Nuxt automatically uses error layouts for error pages. You can create custom error pages:
vue
<!-- app/pages/[...slug].vue - Catch-all for 404 -->
<script setup lang="ts">
definePageMeta({
layout: 'error-layout'
})
</script>When to Use ​
Use the error layout for:
- ✅ 404 error pages
- ✅ 500 error pages
- ✅ Other error states
- ✅ Pages that need
v-mainwrapper without navigation
Styling ​
Uses Vuetify's v-main component which provides:
- Proper padding and spacing
- Theme-aware styling
- Responsive behavior
Pages using this layout can add custom error styling.
Related Documentation ​
- Layouts Overview - All layouts
- Pages - Error Pages - Error page documentation
- Styling - Error Pages - Error page styles