问题描述
在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
这篇关于阿尔及利亚未能在Netlify部署上建立索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!