Giter VIP home page Giter VIP logo

Comments (19)

richhiggins avatar richhiggins commented on May 23, 2024 2

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.

kuworking avatar kuworking commented on May 23, 2024 1

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.

dreamer01 avatar dreamer01 commented on May 23, 2024 1

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?

Screenshot 2020-03-22 at 3 39 18 PM

The workaround I found is to clear your indexes from Algolia and then run the build.

from gatsby-plugin-algolia.

Haroenv avatar Haroenv commented on May 23, 2024

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.

janosh avatar janosh commented on May 23, 2024

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.

Haroenv avatar Haroenv commented on May 23, 2024

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.

janosh avatar janosh commented on May 23, 2024

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.

Haroenv avatar Haroenv commented on May 23, 2024

that would seem quite unlikely. What are the other plugins you're using?

from gatsby-plugin-algolia.

janosh avatar janosh commented on May 23, 2024

Another possibility just occured to me. One difference between my local gatsby builds 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.

Haroenv avatar Haroenv commented on May 23, 2024

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.

kuworking avatar kuworking commented on May 23, 2024

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.

richhiggins avatar richhiggins commented on May 23, 2024

I'm seeing this too, and inconsistently too. for me it hangs like this -

image

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.

janosh avatar janosh commented on May 23, 2024

@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.

richhiggins avatar richhiggins commented on May 23, 2024

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.

dreamer01 avatar dreamer01 commented on May 23, 2024

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?

Screenshot 2020-03-22 at 3 39 18 PM

from gatsby-plugin-algolia.

dreamer01 avatar dreamer01 commented on May 23, 2024

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.

prichey avatar prichey commented on May 23, 2024

I'm seeing this as well, has anyone figured out a reliable solution?

from gatsby-plugin-algolia.

Haroenv avatar Haroenv commented on May 23, 2024

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.

Haroenv avatar Haroenv commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.