【问题标题】:Netlify build fail with Gatsby site. Images盖茨比网站的 Netlify 构建失败。图片
【发布时间】: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 中提取它们?

标签: gatsby netlify


【解决方案1】:

这只是我的文件的大小写问题,而 github 无法识别文件名更改。现在一切正常,谢谢!

【讨论】:

    猜你喜欢
    • 2021-04-08
    • 2021-04-05
    • 1970-01-01
    • 2021-12-14
    • 1970-01-01
    • 2019-09-29
    • 2020-02-02
    • 2023-03-26
    • 2020-05-23
    相关资源
    最近更新 更多