Comments (19)
I seem to have solved this by refactoring to a single algolia query. we also experience the issue on another project, my current theory there is the _tmp index is being written to concurrently causing issues. planning to rename that temp index with a time stamp to test that theory out
from gatsby-plugin-algolia.
For me, the error appears when this code is included. So if I eliminate the lines marked with >>>>>
I don't see the error with the "id" property (code located in gatsby-node.esm.js
)
exports.onCreatePage = ({ page, actions }) => {
const { createPage, deletePage } = actions
const oldPage = Object.assign({}, page)
if (page.path !== `/`) page.path = page.path.replace(/\/$/, ``)
if (/^.\d{4}\.\d{2}\.\d{2}\./.test(page.path)) page.path = '/' + page.path.split('.').pop()
>>>>> if (page.path !== oldPage.path) {
>>>>> deletePage(oldPage)
>>>>> createPage(page)
>>>>> }
}
Since this is not related to the plugin, I've submitted a question in gatsby
from gatsby-plugin-algolia.
I am still facing the same issue, my build is stuck/freeze at Algolia Query Indexing and copying.
Has anybody found any solution or workaround for this?
The workaround I found is to clear your indexes from Algolia and then run the build.
from gatsby-plugin-algolia.
there seem to be two things, the maximum time exceeded, as well as an id of undefined
. I don't exactly recognise both of those, but can you try to see which code in Gatsby throws that error?
from gatsby-plugin-algolia.
The line that throws the error is
state.delete(action.payload.id);
in gatsby/dist/redux/reducers/nodes.js
"use strict";
module.exports = (state = new Map(), action) => {
switch (action.type) {
case `DELETE_CACHE`:
return new Map();
case `CREATE_NODE`:
{
state.set(action.payload.id, action.payload);
return state;
}
case `ADD_FIELD_TO_NODE`:
case `ADD_CHILD_NODE_TO_PARENT_NODE`:
state.set(action.payload.id, action.payload);
return state;
case `DELETE_NODE`:
{
state.delete(action.payload.id);
return state;
}
case `DELETE_NODES`:
{
action.payload.forEach(id => state.delete(id));
return state;
}
default:
return state;
}
};
//# sourceMappingURL=nodes.js.map
Somehow gatsby-plugin-algolia
seems to be creating actions of type DELETE_NODE
without a payload.
from gatsby-plugin-algolia.
That's really odd, since the plugin doesn't even create nodes, it only queries the graphql 🤔 I think the error is unrelated
from gatsby-plugin-algolia.
Could it be gatsby-plugin-algolia
conflicting with another package? Because these types of errors only started occuring after I started using it and netlify build always fails during Algolia: query [n]: moving copied index to main index
.
from gatsby-plugin-algolia.
that would seem quite unlikely. What are the other plugins you're using?
from gatsby-plugin-algolia.
Another possibility just occured to me. One difference between my local gatsby build
s and those running on netlify is that locally there's at most one build going on at a time.
If I immediately merge a pull request in one of my repos, however, netlify builds the deploy preview and the master branch simultaneously. Could it be that both processes trying to access my Algolia indices simultaneously is causing this problem?
from gatsby-plugin-algolia.
That is possibly a source of a bug (you should probably give staging a separate index name), but it would surprise me if that throws an error like the one described, since that code isn't used in the plugin
from gatsby-plugin-algolia.
I'm seeing the same error, even though in my case it doesn't stop the compilation (in run develop
, haven't tried build
yet)
- This is a package of mine (no angolia)
- I have no property "id"in the whole package
- The package is a gatsby theme that if run alone doesn't give this error, but run with the child theme gives this error
- But a copy of the same package with a child theme that is presumably a copy of that theme, doesn't give any error (I cannot discard a difference in some dependencies versions)
So in my case this error has to be unrelated to an "id" property of (in this case) my module.
*Ah, and I cannot see any consecuence of this error in the site
from gatsby-plugin-algolia.
I'm seeing this too, and inconsistently too. for me it hangs like this -
never gets past that, I have to cancel and trigger a new deploy which may or may not have a different outcome 😕
from gatsby-plugin-algolia.
@richhiggins For me the issue was definitely due to concurrent builds attempting to access or write to the same resources. It completely disappeared once I disabled netlify builds for feature branches and PRs, i.e. with changes to master
the only thing that triggers a build. Have you checked whether that may be the case for you as well?
from gatsby-plugin-algolia.
interesting... I wonder if in my case it's because I have 2 queries which the plugin appears to process asynchronously and they are accessing the same index.
from gatsby-plugin-algolia.
I am still facing the same issue, my build is stuck/freeze at Algolia Query Indexing and copying.
Has anybody found any solution or workaround for this?
from gatsby-plugin-algolia.
I seem to have solved this by refactoring to a single algolia query.
You can refractor it to single query but how were you able to resolve it to multiple indexes, as query options include indexName
also
If could help me with this here is how I am using my queries
const queries = [
{
query: resourceQuery,
transformer: ({ data }) => data.gcms.resources.map(resource => resource),
indexName: `resource`,
},
{
query: blogQuery,
transformer: ({ data }) => {
return data.gcms.blogs.map(blog => blog)
},
indexName: `blog`,
},
]
from gatsby-plugin-algolia.
I'm seeing this as well, has anyone figured out a reliable solution?
from gatsby-plugin-algolia.
If you fork the plugin and comment out the element where it actually saves objects to Algolia, does it still freeze? Does someone have an open source example which fails?
from gatsby-plugin-algolia.
I can't see this being reproduced anymore. If you have this again, please open a new issue with reproduction, thanks!
from gatsby-plugin-algolia.
Related Issues (20)
- Question re: Algolia Search HOT 6
- Unreachable hosts Error HOT 6
- Algolia transformer returns nulls for images that are correctly displayed in built site HOT 1
- Support for Gatsby 5 HOT 2
- Gatsby 4 build broken gatsby-plugin-algolia v1.0.0 HOT 2
- failed to index to Algolia Cannot read properties of undefined (reading 'contentDigest') HOT 3
- Plugin breaking in Gatsby 5 HOT 5
- JavaScript heap out of memory HOT 5
- Add indexName to the gatsby cache key HOT 4
- Why partial partial update is no more optional ? HOT 6
- Enrich your records with Google Analytics data HOT 1
- Request for skipIndexing Option to Avoid Unwanted API Access During CI Builds HOT 2
- Extracting chunks of long text as its own record HOT 2
- Adding headers to graphql query HOT 3
- Error: cannot apply the batch operation on a replica index
- Plugin is deleting Sanity document from index if edited. HOT 3
- Adding new data to existing records is ignored HOT 3
- Gatsby internal.contentDigest is a poor source for deciding whether content needs to be updated HOT 6
- Do we still need the MatchFields and enablePartialUpdate options in config? HOT 2
- Partially update not updating existing object in index HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-plugin-algolia.