Algolia 无法在 netlify 部署上建立索引
Algolia fails to index on netlify deploy
在 netlify 上部署时出现以下错误
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
我得到以下结果
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
后,我发现当我在搜索栏中输入查询时,我可以看到我的 posts 结果很好。但是,每当我单击 post 时,我都会链接到一个奇怪的根目录,例如 0.0.7.226
/post-name.
我最近卸载了所有节点模块并重新安装以确保我的依赖项是最新的。是什么让我出现这个错误?
我的github
更新了 netlify 上的环境变量以成功部署网站,但 0.0.7.226/post-name url 仍然存在
在 netlify 上部署时出现以下错误
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
我得到以下结果
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
后,我发现当我在搜索栏中输入查询时,我可以看到我的 posts 结果很好。但是,每当我单击 post 时,我都会链接到一个奇怪的根目录,例如 0.0.7.226
/post-name.
我最近卸载了所有节点模块并重新安装以确保我的依赖项是最新的。是什么让我出现这个错误?
我的github
更新了 netlify 上的环境变量以成功部署网站,但 0.0.7.226/post-name url 仍然存在