在 netlify 上部署时出现以下错误
On netlify I get the following error when deploying
10:12:15 PM: Algolia: 1 queries to index 10:12:16 PM: Algolia: query 0: executing query 10:12:16 PM: Algolia: query 0: graphql resulted in 230 records 10:12:16 PM: Algolia: query 0: splitting in 1 jobs 10:12:16 PM: error failed to index to Algolia 10:12:16 PM: 10:12:16 PM: 10:12:16 PM: TypeError: Cannot read property 'addObjects' of undefined 10:12:16 PM: 10:12:16 PM: - gatsby-node.js:161 10:12:16 PM: [repo]/[gatsby-plugin-algolia]/gatsby-node.js:161:43 10:12:16 PM: 10:12:16 PM: - Array.map 10:12:16 PM: 10:12:16 PM: - gatsby-node.js:160 doQuery 10:12:16 PM: [repo]/[gatsby-plugin-algolia]/gatsby-node.js:160:30 10:12:16 PM: 10:12:16 PM: - async Promise.all 10:12:16 PM: 10:12:16 PM: - gatsby-node.js:187 async Object.exports.onPostBuild 10:12:16 PM: [repo]/[gatsby-plugin-algolia]/gatsby-node.js:187:5 10:12:16 PM: 10:12:16 PM: 10:12:16 PM: not finished onPostBuild - 1.338s但是当我执行 gatsby build 时,我得到以下内容
But when I do gatsby build I get the following
Algolia: 1 queries to index Algolia: query 0: executing query Algolia: query 0: graphql resulted in 230 records Algolia: query 0: splitting in 1 jobs Algolia: query 0: moving copied index to main index ⠼ onPostBuild info Generated public/sw.js, which will precache 9 files, totaling 446903 bytes. The following pages will be precached: /offline-plugin-app-shell-fallback/index.html success onPostBuild - 6.228s在执行 gatsby serve 之后,我发现当我在搜索栏中输入查询时,我可以很好地看到我的帖子结果.但是,每当我点击帖子时,我都会链接到一个奇怪的根目录,例如 0.0.7.226/post-name.
After doing gatsby serve I see that I can see my posts results fine as I type through queries in the searchbar. However, whenever I click on a post, I get linked to a strange root such as 0.0.7.226/post-name.
我最近卸载了所有节点模块并重新安装以确保我的依赖项是最新的.是什么让我出现这个错误?
I recently uninstalled all node modules and reinstalled to make sure my dependencies are up to date. What is getting me this error?
我的github
推荐答案更新了 netlify 上的 env 变量以成功部署网站,但 0.0.7.226/post-name url 仍然存在
Updated the env variables on netlify to successfully deploy the website but the 0.0.7.226/post-name url persists
更多推荐
Algolia 无法在 netlify 部署上建立索引
发布评论