nuxt/nuxt

bug: `route.meta.layout` is undefined when using appLayout in Nuxt 4.3.1

Open

#34 305 ouverte le 10 févr. 2026

Voir sur GitHub
 (4 commentaires) (2 réactions) (0 assignés)TypeScript (60 221 stars) (5 607 forks)batch import
good first issue🔨 p3-minor

Description

Environment

Operating system Windows 10.0.26200
CPU 12th Gen Intel(R) Core(TM) i5-12600KF (16 cores)
Node.js version v22.20.0
nuxt/cli version 3.33.1
Package manager pnpm@10.26.1
Nuxt version 4.3.1
Nitro version 2.13.1
Builder vite@7.3.1
Config app, compatibilityDate, css, devServer, devtools, eslint, hub, i18n, modules, routeRules, runtimeConfig, ui, vite
Modules @nuxt/eslint@1.12.1, @nuxt/ui@4.4.0, @nuxt/image@2.0.0, @nuxtjs/i18n@10.2.1, @vueuse/nuxt@14.1.0, @nuxthub/core@0.10.5

Reproduction

https://stackblitz.com/edit/nuxt-examples-czvopdeg?file=app.vue

Describe the bug

I encountered a regression when upgrading from Nuxt 4.2.2 to 4.3.1. When the appLayout option is enabled, route.meta.layout no longer retrieves the correct value automatically. It only works as expected if I explicitly define the layout using definePageMeta({ layout: 'custom' }) on each page.

This behavior introduces two major issues:

Breaking Consistency: There is a clear inconsistency in how route.meta.layout behaves between these versions.

Redundancy: One of the primary goals of the appLayout feature is to eliminate the need for boilerplate code (declaring definePageMeta on every single page). This current behavior seems to contradict the original intent of issue #26615.

see: #31092

Additional context

No response

Logs

Guide contributeur