2023-07-05 15:11:16 +02:00
|
|
|
---
|
|
|
|
title: Cannot output to /static
|
|
|
|
---
|
2021-01-11 14:34:58 +01:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Why This Error Occurred
|
2021-01-11 14:34:58 +01:00
|
|
|
|
|
|
|
Either you set `distDir` to `static` in your `next.config.js` or during `next export` you tried to export to the `static` directory.
|
|
|
|
|
2021-06-24 06:33:58 +02:00
|
|
|
This is not allowed because `static` is used by Next.js to serve static assets.
|
2021-01-11 14:34:58 +01:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Possible Ways to Fix It
|
2021-01-11 14:34:58 +01:00
|
|
|
|
|
|
|
Use a different `distDir` or export to a different folder.
|
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
## Useful Links
|
2021-01-11 14:34:58 +01:00
|
|
|
|
2023-07-05 15:11:16 +02:00
|
|
|
- [Static file serving docs](/docs/pages/building-your-application/optimizing/static-assets)
|