mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
0b35ddd825
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
20 lines
913 B
Plaintext
20 lines
913 B
Plaintext
---
|
|
title: Max Custom Routes Reached
|
|
---
|
|
|
|
## Why This Error Occurred
|
|
|
|
The number of combined routes from `headers`, `redirects`, and `rewrites` exceeds 1000. This can impact performance because each request will iterate over all routes to check for a match in the worst case.
|
|
|
|
## Possible Ways to Fix It
|
|
|
|
- Leverage dynamic routes inside of the `pages` folder to reduce the number of rewrites needed
|
|
- Combine headers routes into dynamic matches e.g. `/first-header-route` `/second-header-route` -> `/(first-header-route$|second-header-route$)`
|
|
|
|
## Useful Links
|
|
|
|
- [Dynamic Routes documentation](/docs/pages/building-your-application/routing/dynamic-routes)
|
|
- [Rewrites documentation](/docs/pages/api-reference/config/next-config-js/rewrites)
|
|
- [Redirects documentation](/docs/pages/api-reference/config/next-config-js/redirects)
|
|
- [Headers documentation](/docs/pages/api-reference/config/next-config-js/headers)
|