rsnext/errors/invalid-segment-export.mdx
Delba de Oliveira 44d1a1cb15
docs: Migrate error messages to MDX and App Router. (#52038)
This PR is part of a larger effort to migrate error messages to MDX and
use App Router: https://github.com/vercel/front/pull/23459
2023-07-05 06:11:16 -07:00

13 lines
786 B
Text

---
title: Invalid Layout or Page Export
---
## Why This Error Occurred
Your [layout](/docs/app/api-reference/file-conventions/layout) or [page](/docs/app/api-reference/file-conventions/page) inside the app directory exports an invalid field. In these files, you're only allowed to export a default React component, or [Segment Configuration Options](/docs/app/api-reference/file-conventions/route-segment-config) for layout and pages, such as `revalidate`, `generateStaticParams`, etc.
Other custom exports are not allowed to catch misspelt configuration options and prevent conflicts with future options.
## Possible Ways to Fix It
You can create a new file and co-locate it with the page or layout. In the new file, you can export any custom fields and import it from anywhere.