【发布时间】:2020-11-12 14:10:05
【问题描述】:
我在 Netlify 上部署我的网站时遇到问题。在 Netlify 环境中,我得到一个:
3:30:14 PM: failed Building production JavaScript and CSS bundles - 37.321s 3:30:14 PM: error Generating JavaScript bundles failed 3:30:14 PM: Can't resolve '../../../images/inside-shop-dark.jpg' in '/opt/build/repo/src/pages/style/Index' 3:30:14 PM: If you're trying to use a package make sure that '../../../images/inside-shop-dark.jpg' is installed. If you're trying to use a local file make sure that the path is correct.
对于一些图像,但路径是正确的,一切都在本地工作,它在本地构建没有问题,但我似乎无法使用 Netlify 成功构建。
【问题讨论】:
-
您使用的是 Gatsby Image 还是只是一个 img 标签?您是对图像路径进行硬编码,还是从frontmatter 中提取它们?