Files
vercel__next.js/errors/page-without-valid-component.mdx
Delba de Oliveira 0b35ddd825 Docs: Move next.config.js API pages under a config folder, fix headings in TS and ESLint config pages (#72465)
This PR:

- Moves `next.config.js` options under a "config" folder which includes
references for other configuration such as the ESLint plugin. I figure
it would be tidier than having "Next.config.js Options" and "Config" in
the API reference.
- Fixes the issue with the "config" folder not showing up in canary:
https://linear.app/vercel/issue/DOC-3749/bug-figure-out-why-new-config-folder-isnt-showing-up-in-the-canary
- Fixes the indentation issues and missing example header (caused by an
invisible character).

Redirects: https://github.com/vercel/front/pull/38704
2024-11-08 14:48:55 +00:00

21 lines
1.1 KiB
Plaintext

---
title: Page Without Valid React Component
---
## Why This Error Occurred
A page that does not export a valid React Component was found while analyzing the build output.
This is a hard error because the page would error when rendered, and causes poor build performance.
## Possible Ways to Fix It
Investigate the list of page(s) specified in the error message.
For each, you'll want to check if the file is meant to be a page.
If the file is not meant to be a page, and instead, is a shared component or file, move the file to a different folder like `components` or `lib`.
If the file is meant to be a page, double check you have an `export default` with the React Component instead of an `export`. If you're already using `export default`, make sure the returned value is a valid React Component.
If you need to support a different file extension for a page component (such as `.mdx`) or would like to include non-page files in the `pages` directory, configure [Custom Page Extensions](/docs/pages/api-reference/config/next-config-js/pageExtensions) in the `next.config.js`.