gatsby: 5.10 is buggy with linked nodes in custom schema. They are null until cache clean and rebuild. Will eventually corrupt again.
Preliminary Checks
- This issue is not a duplicate. Before opening a new issue, please search existing issues: https://github.com/gatsbyjs/gatsby/issues
- This issue is not a question, feature request, RFC, or anything other than a bug report directly related to Gatsby. Please post those things in GitHub Discussions: https://github.com/gatsbyjs/gatsby/discussions
Description
Linked nodes in custom schema are no longer being reliably populated. Corruption is being cached. Nodes return null.
Reproduction Link
https://githubbox.com/gatsbyjs/gatsby-starter-minimal
Steps to Reproduce
- Create a working site, with a custom schema
fullUrl: String
asset: ContentfulAsset
@link(from: "asset___NODE")
brandfolderAsset: [contentfulImageAssetsBrandfolderAssetJsonNode]
@link(from: "brandfolderAsset___NODE")
}
- Do incremental builds in Gatsby cloud by updating content
- Evenutally “asset” will return null
- Clear cache and force a manual rebuild in Gatsby cloud, and your content is back …
Expected Result
Reliability
Actual Result
Missing fields
Environment
System:
OS: Linux 5.15 Ubuntu 20.04.4 LTS (Focal Fossa)
CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor
Shell: 5.0.17 - /bin/bash
Binaries:
Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
npmPackages:
gatsby: ^5.10.0 => 5.10.0
gatsby-plugin-canonical-urls: ^5.10.0 => 5.10.0
gatsby-plugin-gatsby-cloud: ^5.10.0 => 5.10.0
gatsby-plugin-image: ^3.10.0 => 3.10.0
gatsby-plugin-node-fields: ^3.1.0 => 3.1.0
gatsby-plugin-react-helmet: ^6.10.0 => 6.10.0
gatsby-plugin-sitemap: ^6.10.0 => 6.10.0
gatsby-source-contentful: ^8.10.0 => 8.10.0
npmGlobalPackages:
gatsby: 5.10.0
Config Flags
DEV_SSR: true
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 5
- Comments: 32 (4 by maintainers)
The depreciation warning is not an issue. Everyone has this using the current version of the Contentful plugin.
We have a new version coming up, it will generate the schema in the proper way Gatsby expects it.
https://github.com/gatsbyjs/gatsby/issues/31385 https://github.com/gatsbyjs/gatsby/pull/30855
The patch is public via
gatsby-source-contentful@8.13.0-next.1
Can’t be happier to find this issue, haha. It’s been days we are struggling with this too.
Sometimes Gatsby builds are ok (on Gatsby Cloud or locally). But often the cache seems to get corrupted and only a manual “clear cache and restart” can solve it (it may still fail).
Details:
Curious things that are happening in a failed build:
Note the plugin “null”, that’s not appearing on a successful build.
Then it crashes on this error.
In short, the graphQL schema seems to be corrupted, and the related fields are not the right match anymore.