Error: Image Optimization using Next.js default loader is not compatible with `next export`
I got this error when deploying Next.js to Netlify. Error: Image Optimization using Next.js default loader is not compatible with `next export`. Possible solutions: 6:47:15 AM: - Use `next start`, which starts the Image Optimization API. 6:47:15 AM: - Use Vercel to deploy, which supports Image Optimization. 6:47:15 AM: - Configure a third-party loader in `next.config.js`. 6:47:15 AM: - Read more: https://err.sh/next.js/export-image-api. 6:47:15 AM: at exportApp (/opt/build/repo/node_modules/next/dist/export/index.js:14:712) The problem does not occur when deploying to Vercel.
From Next.js 12.3, you can completely disable next/image Image Optimization using the unoptimized configuration in next.config.js. This avoids having to use a third-party provider to optimize the image when using next/export. From the next/image documentation: unoptimized - When true, the source image will be served as-is instead of changing quality, size, or format. Defaults to false. module.exports = { images: { unoptimized: true } } Before Next.js 12.3 and from 12.2, the unoptimized configuration was still experimental and could be enabled under the experimental flag. module.exports = { experimental: { images: { unoptimized: true } } }
Get this solution programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/error/1a4fb4f8626c03059090312eae4c367aeadeb2e0662d550ab066d5a502ab16cf