Skip to content

Commit

Permalink
Update error message for next export and next/image. (#23061)
Browse files Browse the repository at this point in the history
  • Loading branch information
leerob authored Mar 15, 2021
1 parent c4508d1 commit a63c64a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion errors/export-image-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ This is because Next.js optimizes images on-demand, as users request them (not a
#### Possible Ways to Fix It

- Use `next start` to run a server, which includes the Image Optimization API.
- Use Vercel to deploy, which supports [Image Optimization](https://vercel.com/docs/next.js/image-optimization).
- Use any provider which supports Image Optimization (like [Vercel](https://vercel.com/docs/next.js/image-optimization)).
- Configure a third-party [loader](https://nextjs.org/docs/basic-features/image-optimization#loader) in `next.config.js`.
- Use the [`loader`](https://nextjs.org/docs/api-reference/next/image#loader) prop for `next/image`.

### Useful Links

Expand Down
5 changes: 3 additions & 2 deletions packages/next/export/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,10 @@ export default async function exportApp(
throw new Error(
`Image Optimization using Next.js' default loader is not compatible with \`next export\`.
Possible solutions:
- Use \`next start\`, which starts the Image Optimization API.
- Use Vercel to deploy, which supports Image Optimization.
- Use \`next start\` to run a server, which includes the Image Optimization API.
- Use any provider which supports Image Optimization (like Vercel).
- Configure a third-party loader in \`next.config.js\`.
- Use the \`loader\` prop for \`next/image\`.
Read more: https://err.sh/next.js/export-image-api`
)
}
Expand Down

0 comments on commit a63c64a

Please sign in to comment.