From a63c64a02d0f7cd05544b55bc85db42b41c85c15 Mon Sep 17 00:00:00 2001 From: Lee Robinson Date: Mon, 15 Mar 2021 13:01:12 -0500 Subject: [PATCH] Update error message for next export and next/image. (#23061) --- errors/export-image-api.md | 3 ++- packages/next/export/index.ts | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/errors/export-image-api.md b/errors/export-image-api.md index f43b203864..dae959c90d 100644 --- a/errors/export-image-api.md +++ b/errors/export-image-api.md @@ -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 diff --git a/packages/next/export/index.ts b/packages/next/export/index.ts index fe2f09f284..1031faf045 100644 --- a/packages/next/export/index.ts +++ b/packages/next/export/index.ts @@ -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` ) } -- GitLab