rsnext/errors/can-not-output-to-public.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

17 lines
482 B
Text

---
title: Cannot output to /public
---
## Why This Error Occurred
Either you set `distDir` to `public` in your `next.config.js` or during `next export` you tried to export to the `public` directory.
This is not allowed because `public` is used by Next.js to serve static assets.
## Possible Ways to Fix It
Use a different `distDir` or export to a different folder.
## Useful Links
- [Static file serving docs](/docs/pages/building-your-application/optimizing/static-assets)