--- title: 'NUXT_E2007' description: 'setPageLayout called on server within component.' navigation: false --- # E2007 `setPageLayout()` was called from a component's `setup()` during SSR. On the server the layout must be decided before the component renders, so changing it here produces incorrect SSR output. ## Resolution Set the layout from route middleware, or statically with `definePageMeta({ layout: '...' })`. ::read-more{to="/docs/api/utils/set-page-layout"} ::