通过github.io渲染静态网页不起作用-对于使用gatsby创建的网站/托管在github存储库上的netlify

时间:2019-07-10 06:51:04

标签: reactjs github yarnpkg gatsby netlify

我想为在此链接-https://github.com/bchiang7/v4中找到的github.io个人资料使用个人网站模板。我对其进行了个性化设置,并将其托管在netlify.com的以下链接上-https://objective-shannon-b564f7.netlify.com。在netlifly上看起来很完美!但是,当我下载deploy-static文件并通过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的对等依赖关系-所以我在package.json文件中添加了“ webpack”:“ 4.4.0”,并且该警告消息为不再存在。

    警告“ 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部署的文件中存在的文件夹?

1 个答案:

答案 0 :(得分:0)

最近在Gatsby v2.11.1中对其进行了修补。您可以see the full issue thread on Github here