next.js
a6a9d65c - fix: helpful error when `output: export` and `next export -o` (#51191)

Commit
2 years ago
fix: helpful error when `output: export` and `next export -o` (#51191) We already have a warning when using `next export` with `output: export` because the `next export` is effectively a no-op (the exported output was already generated during `next build`). However, this PR ensures that `next export -o <dir>` throws an error when `output: export` is defined because the files were already emitted to the `distDir` in the `next build` step and we can't safely no-op at this point. We also guide the user to the correct solution which is to use `output: export` along with `distDir: <dir>` in your next.config.js (instead of mixing legacy behavior with the new behavior). fix #48207 fix NEXT-980
Author
Parents
Loading