mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
d5359765dd
Closes: - https://linear.app/vercel/issue/DOC-4550/static-exports - https://linear.app/vercel/issue/DOC-4551/self-hosting Redirects: https://github.com/vercel/front/pull/44237 --------- Co-authored-by: Lee Robinson <lee@leerob.com>
23 lines
978 B
Plaintext
23 lines
978 B
Plaintext
---
|
|
title: Export Custom Routes
|
|
---
|
|
|
|
## Why This Error Occurred
|
|
|
|
In your `next.config.js` you defined `rewrites`, `redirects`, or `headers` along with `output: 'export'` (or you ran `next export`).
|
|
|
|
These configs do not apply when exporting your Next.js application manually.
|
|
|
|
## Possible Ways to Fix It
|
|
|
|
- Remove `rewrites`, `redirects`, and `headers` from your `next.config.js` to disable these features or
|
|
- Remove `output: 'export'` (or `next export`) in favor of [`next start`](/docs/pages/api-reference/cli/next#next-start-options) to run a production server
|
|
|
|
## Useful Links
|
|
|
|
- [Deployment Documentation](/docs/pages/getting-started/deploying)
|
|
- [`output: 'export'` Documentation](/docs/pages/guides/static-exports)
|
|
- [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)
|