错误:使用Next.js默认加载程序的镜像优化与`Next export`不兼容 [英] Error: Image Optimization using Next.js default loader is not compatible with `next export`

查看:24
本文介绍了错误:使用Next.js默认加载程序的镜像优化与`Next export`不兼容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将Next.js部署到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)

部署到Vercel时未出现此问题。

推荐答案

您似乎使用了NEXT/IMAGES。 但是next/images不支持静电页面(使用next export生成) 对于静电页面,请改用此图像优化器:next-optimized-images

这篇关于错误:使用Next.js默认加载程序的镜像优化与`Next export`不兼容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆