Files
vercel__next.js/errors/export-image-api.mdx
Delba de Oliveira 3bf570d84d Docs IA 2.0: Images (#78769)
Closes:
- https://linear.app/vercel/issue/DOC-4626/images
- https://linear.app/vercel/issue/DOC-4610/split-image-and-font-pages

Redirects: https://github.com/vercel/next.js/pull/78769

**Housekeeping:** 
- Deletes BYA images page
- Creates relevant getting started docs in `/pages`
- Splits "Images and Fonts" into "Images" and "Fonts" pages to allow us
to add more context to each page in the future

**API reference**: 
- Improves image API reference to follow more of a consistent format and
language
- Adds examples

**Follow-up:** https://github.com/vercel/next.js/pull/78857
- Create a Deep Dive Guide on how image optimization works

---------

Co-authored-by: Rich Haines <hello@richardhaines.dev>
2025-05-08 13:11:38 +01:00

27 lines
1.3 KiB
Plaintext

---
title: Export with Image Optimization API
---
## Why This Error Occurred
You configured `output: 'export'` (or ran `next export`) while importing the `next/image` component using the default `loader` configuration.
However, the default `loader` relies on the Image Optimization API which is not available for exported applications.
This is because Next.js optimizes images on-demand, as users request them (not at build time).
## Possible Ways to Fix It
- Use [`next start`](/docs/pages/api-reference/cli/next#next-start-options) to run a server, which includes the Image Optimization API.
- Use any provider which supports Image Optimization (such as [Vercel](https://vercel.com)).
- [Configure `loader`](/docs/pages/api-reference/components/image#loader) in `next.config.js`.
- [Configure `unoptimized`](/docs/pages/api-reference/components/image#unoptimized) in `next.config.js`.
## Useful Links
- [Deployment Documentation](/docs/pages/getting-started/deploying)
- [Image Optimization Documentation](/docs/pages/api-reference/components/image)
- [`output: 'export'` Documentation](/docs/pages/guides/static-exports)
- [`next/image` Documentation](/docs/pages/api-reference/components/image)
- [Vercel Documentation](https://vercel.com/docs/concepts/next.js/image-optimization)