Closed h1eutran closed 3 years ago
Looks like in this line you explicitly remove the id/objectID field: https://github.com/GuillouTran/guilloutran.com/blob/algolia/src/utils/algolia-queries.js#L27
An id is required for this plugin. Normally we throw a readable error in that case though, do you have logs of the failure?
@Haroenv oh, j'ai oublié! Merci Beaucoup! Ca marche maintenant. Ma nouvelle configuration:
const escapeStringRegexp = require("escape-string-regexp")
const pageQuery = `
query LandingQuery {
allMarkdownRemark(sort: { fields: [fields___date], order: DESC }) {
edges {
node {
id
fields {
slug
date
}
excerpt
timeToRead
frontmatter {
title
tags
cover
date
}
}
}
}
}
`;
function pageToAlgoliaRecord({ node: { id, frontmatter, fields, ...rest } }) {
return {
objectID: id,
...frontmatter,
...fields,
...rest,
}
}
const queries = [
{
query: pageQuery,
transformer: ({ data }) => data.allMarkdownRemark.edges.map(pageToAlgoliaRecord), // optional
indexName: 'prod_GuillouTran', // overrides main index name, optional
},
];
module.exports = queries
Thanks for confirming that it works, but I wonder what error you got before this, did it say anything about a missing objectID?
Nope! It doesn't said anything! I tried to replace stuff and swapping things but it just creating more errors. Haven't seen it mention missing objectID
I'll leave this open as a marker to check why the error did not catch this
Okay! It's strange though because I see that this is the only error I ever stumble across that doesn't have a specifically error message.
I'm currently experiencing this for local builds on OSX (High Sierra) - it rarely completes.
We deploy our production app to Heroku and the problem does not occur on the Heroku build servers.
On Heroku it usually completes indexing in around 13 seconds.
Have you try and remove dependencies, clear cache and try again
I think this individual issue is solved, if you have a similar behaviour, please open an issue with reproduction :)
Quite similar with this issues: Issues 55
My Queries Settings:
And my Gatsby config:
This is the link to the branch that been created for this issue: https://github.com/GuillouTran/guilloutran.com/commits/algolia