File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -458,9 +458,17 @@ export default defineNuxtModule<ModuleOptions>({
458458 } )
459459 }
460460 } )
461- nuxt . hook ( 'app:resolve' , ( app ) => {
461+ nuxt . hook ( 'app:resolve' , async ( app ) => {
462462 if ( app . mainComponent ?. includes ( '@nuxt/ui-templates' ) ) {
463463 app . mainComponent = resolveRuntimeModule ( './app.vue' )
464+ } else {
465+ const appContent = await fs . promises . readFile ( app . mainComponent ! , { encoding : 'utf-8' } )
466+ if ( appContent . includes ( '<NuxtLayout' ) || appContent . includes ( '<nuxt-layout' ) ) {
467+ logger . warn ( [
468+ 'Using `<NuxtLayout>` inside `app.vue` will cause unwanted layout shifting in your application.' ,
469+ 'Consider removing `<NuxtLayout>` from `app.vue` and using it in your pages.'
470+ ] . join ( '' ) )
471+ }
464472 }
465473 } )
466474 }
You can’t perform that action at this time.
0 commit comments