Git Product home page Git Product logo

Comments (8)

sbuys avatar sbuys commented on August 18, 2024 1

@zzullick we moved to another CMS. We're one of the case studies on the website too 💔.

from gatsby-source-graphcms.

DennisSimon avatar DennisSimon commented on August 18, 2024

Hey everyone,

I have the same issue with buildMarkdownNodes working in development but not in production mode.
Are there any logs that we can provide to assist in debugging?

from gatsby-source-graphcms.

sbuys avatar sbuys commented on August 18, 2024

@notrab anything we can do to help on this one? We are stuck in a holding pattern on a few projects.

from gatsby-source-graphcms.

DennisSimon avatar DennisSimon commented on August 18, 2024

So i managed to work around the issue in my case, which is very similar to the case that you posted as an example @sbuys.
Here is a quick rundown of what i changed:

Previously, i was simply querying the ids of all posts/pages that contained the markdownNodes in gatsby-node.js, passed them to the gatsby template pages via the context and then retrieved all required fields within the template via page queries.

I found that when i query all required fields within gatsby-node and then pass all of them via the context, the markdownNodes are not null anymore.

I am guessing that this might be either due to some sort of race-condition (might explain why it works during development as the fields are queried on demand) or an issue where certain nodes are simply not available during page queries.

from gatsby-source-graphcms.

DennisSimon avatar DennisSimon commented on August 18, 2024

Another piece of information:

I noticed that the workaround i posted above suddenly stopped working.
To get it working again, i needed to clean the cache and rebuild.

So it might also be a caching issue?

from gatsby-source-graphcms.

sbuys avatar sbuys commented on August 18, 2024

@DennisSimon thanks for the update. I'll look into the caching and report back.

from gatsby-source-graphcms.

sbuys avatar sbuys commented on August 18, 2024

@DennisSimon The problem actually seems tied to the code in onCreateNode().

Per the documentation for Gatsby v4, mutation of nodes outside of createNode() is an anti-pattern. More info here.

field.value.markdownNode = markdownNode.id will not update the node in the Gatsby store and the fact that it works in development is probably a fluke.

What I'm not sure about is how to use the recommended API createNodeField as it seems you can't alter a field directly.

from gatsby-source-graphcms.

zzullick avatar zzullick commented on August 18, 2024

Any updates or workaround on this issue? Experiencing the same thing with 2.8.0 and gatsby 4.20.0.

from gatsby-source-graphcms.

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.