通过 github.io 呈现静态网页无效 - 对于使用 gatsby 创建的网站/托管在 github 存储库的 netlify 上

Rendering static webpage via github.io not working - for a website created with gatsby / hosted on netlify from a github repo

我想为我在 link - https://github.com/bchiang7/v4 . I personalized it and hosted it on netlify.com at this link - https://objective-shannon-b564f7.netlify.com 中找到的 github.io 个人资料使用个人网站模板。在 netlifly 上它看起来很完美!但是,当我下载部署静态文件并通过 vidyabhandary.github.io 呈现它们时 - 部分站点丢失,其余部分看起来很奇怪。

控制台错误指示缺少 json 文件、一些字体文件和一些资源。

Uncaught Error: Missing resources for /
    at t.n.render (ensure-resources.js:135)
    at Oi (react-dom.production.min.js:173)
    at Ri (react-dom.production.min.js:172)
    at Mi (react-dom.production.min.js:180)
    at $a (react-dom.production.min.js:232)
    at Ka (react-dom.production.min.js:233)
    at Ol (react-dom.production.min.js:249)
    at Cl (react-dom.production.min.js:248)
    at kl (react-dom.production.min.js:245)
    at Ja (react-dom.production.min.js:243)

字体文件和 json 存在于目录路径中,尽管大小写(名称)不匹配。

我在 netlifly 上部署时没有遇到任何错误 - 只是警告说我的 logo.png 不是正方形。

  1. 之前在 netlifly 部署中有一个警告,指出没有满足 gatsby 的对等依赖 - 所以我添加了 "webpack":"4.4.0" 到我的 package.json 文件并且该警告消息不再存在。

    警告 "gatsby-plugin-netlify > webpack-assets-manifest@3.1.1" 具有未满足的对等依赖性 "webpack@>=4.4.0"

  2. 我添加了一个 .nojekyll 文件

  3. 静态文件不变-我是否使用-gatsby build / gatsby build;纱线构建/纱线构建。

不确定我还缺少什么。

'''
    11:18:43 AM: success Building production JavaScript and CSS bundles — 3.647 s
    11:18:44 AM: success Building static HTML for pages — 1.385 s — 4/4 11.30 pages/second
    11:18:44 AM: Generated public/sw.js, which will precache 10 files, totaling 472828 bytes.
    11:18:44 AM: info Done building in 8.671 sec

---

11:18:44 AM: Started saving node modules
11:18:44 AM: Finished saving node modules
11:18:44 AM: Started saving yarn cache
11:18:44 AM: Finished saving yarn cache
11:18:44 AM: Started saving pip cache
11:18:44 AM: Finished saving pip cache
11:18:44 AM: Started saving emacs cask dependencies
11:18:44 AM: Finished saving emacs cask dependencies
11:18:44 AM: Started saving maven dependencies
11:18:44 AM: Finished saving maven dependencies
11:18:44 AM: Started saving boot dependencies
11:18:44 AM: Finished saving boot dependencies
11:18:44 AM: Started saving go dependencies
11:18:44 AM: Finished saving go dependencies
11:18:47 AM: Build script success
11:18:47 AM: Starting to deploy site from 'public/'
11:18:47 AM: Creating deploy tree 
11:18:47 AM: 0 new files to upload
11:18:47 AM: 0 new functions to upload
11:18:47 AM: Starting post processing
11:18:47 AM: Post processing done
11:18:48 AM: Site is live
11:19:15 AM: Finished processing build request in 1m57.314333898s

'''

部分部署日志 - 未显示任何错误。

我是否需要更改作为 netlifly 部署文件的一部分存在的文件夹?

这是最近在 Gatsby v2.11.1 中修补的。你可以 see the full issue thread on Github here.