2019-10-08 15:28:09 +02:00
|
|
|
# Cannot output to /public
|
2019-10-06 13:44:03 +02:00
|
|
|
|
|
|
|
#### 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 due to `public` being a special folder in Next.js used to serve static assets.
|
|
|
|
|
|
|
|
#### Possible Ways to Fix It
|
|
|
|
|
|
|
|
Use a different `distDir` or export to a different folder.
|
|
|
|
|
|
|
|
### Useful Links
|
|
|
|
|
2020-06-18 11:54:07 +02:00
|
|
|
- [Static file serving docs](https://nextjs.org/docs/basic-features/static-file-serving)
|