【发布时间】:2021-03-02 16:29:48
【问题描述】:
我正在使用 Next.js 中的 Image 组件(它是 Next.js 的新功能)。我已尝试提供源 URL:
{`${API}/user/photo/${blog.postedBy.username}`}
但它向我显示了这个错误。我还在我的next.config.js 中进行了更改
module.exports = {
images: {
domains: ['localhost'],
},
}
但对我没有任何作用。如果您对此有所了解,请提供帮助。
【问题讨论】:
-
什么
API?是本地主机吗? -
是的,它是本地主机
标签: reactjs image next.js nextjs-image