【发布时间】:2022-08-16 16:18:03
【问题描述】:
即使在 next.config.js 中正确配置了 cdn 域,我也开始收到此错误。
在搜索了几个小时没有答案后,所以我在下面发布答案以供将来参考。
标签: next.js next-images
即使在 next.config.js 中正确配置了 cdn 域,我也开始收到此错误。
在搜索了几个小时没有答案后,所以我在下面发布答案以供将来参考。
标签: next.js next-images
我在这里找到它next-docs
您所要做的就是将模块导出更改为文档中描述的异步函数。
module.exports = async (phase, { defaultConfig }) => {
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
/* config options here */
images: {
domains: ['***your domains here***'],
},
};
return nextConfig;
};
【讨论】: