Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add warning when exporting with custom routes (#17538)
This adds a warning when `next export` and custom routes are defined outside of a platform that supports them since they won't be applied anymore.
- Loading branch information
Showing
3 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# `next export` No Custom Routes | ||
|
||
#### Why This Error Occurred | ||
|
||
In your `next.config.js` `rewrites`, `redirects`, or `headers` were defined while `next export` was being run outside of a platform that supports them. | ||
|
||
These configs do not apply when exporting your Next.js application manually. | ||
|
||
#### Possible Ways to Fix It | ||
|
||
Disable the `rewrites`, `redirects`, and `headers` from your `next.config.js` when using `next export` to deploy your application or deploy your application using [a method](https://nextjs.org/docs/deployment#vercel-recommended) that supports these configs. | ||
|
||
### Useful Links | ||
|
||
- [Deployment Documentation](https://nextjs.org/docs/deployment#vercel-recommended) | ||
- [`next export` Documentation](https://nextjs.org/docs/advanced-features/static-html-export) | ||
- [Rewrites Documentation](https://nextjs.org/docs/api-reference/next.config.js/rewrites) | ||
- [Redirects Documentation](https://nextjs.org/docs/api-reference/next.config.js/redirects) | ||
- [Headers Documentation](https://nextjs.org/docs/api-reference/next.config.js/headers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters