question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

gatsby-source-wordpress issue when migrating to gatsby v3

See original GitHub issue

Description

Describe the issue that you’re seeing.

I’ve upgraded from Gatsby v2 to v3 and get a critical error when running develop and build:

Interfaces with the `nodeInterface` extension must have a field `id` of type `ID!`. Check the type definition of `WpBlockEditorContentNode`.

I upgraded React and all gatsby plugins to the latest version, including gatsby-source-wordpress.

Steps to reproduce

Clear steps describing how to reproduce the issue. Please link to a reproduction, this makes your issue much easier to diagnose (seriously).

Update form gastby v2.* to v3.

I noticed that that’s a wordpress cache file. Deleted that, but still see the same issue.

I’ve also made sure that any Gatsby and GraphQL plugins are up-to-date in Wordpress.

How to Make a Minimal Reproduction: https://www.gatsbyjs.com/contributing/how-to-make-a-reproducible-test-case/

Expected result

What should happen? Build should complete or a more details error should be displayed.

Actual result

This error:

warn Deprecation warning: `@nodeInterface` extension is deprecated and will be removed in Gatsby v4. Use interface inheritance instead.
To upgrade replace the old format:
  interface `WpBlockEditorContentNode` @nodeInterface
with the new one (in `createTypes` action of schema customization API):
  interface `WpBlockEditorContentNode` implements Node
Read more about schema customization here:
https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/

 ERROR 

Interfaces with the `nodeInterface` extension must have a field `id` of type `ID!`. Check the type definition of `WpBlockEditorContentNode`.

not finished building schema - 0.141s

What happened.

Environment

System: OS: macOS 11.2.2 CPU: (8) x64 Apple M1 Shell: 5.8 - /bin/zsh Binaries: Node: 14.15.1 - /usr/local/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 6.14.8 - /usr/local/bin/npm Languages: Python: 2.7.16 - /usr/bin/python Browsers: Chrome: 88.0.4324.192 Firefox: 86.0 Safari: 14.0.3 npmPackages: gatsby: ^3.0.0 => 3.0.0 gatsby-background-image: ^1.4.1 => 1.4.1 gatsby-cli: ^3.0.0 => 3.0.0 gatsby-gravityforms-component: ^3.1.0 => 3.1.0 gatsby-image: ^3.0.0 => 3.0.0 gatsby-plugin-build-date: ^1.0.0 => 1.0.0 gatsby-plugin-bundle-stats: ^2.6.0 => 2.6.0 gatsby-plugin-client-side-redirect: ^1.1.0 => 1.1.0 gatsby-plugin-facebook-pixel: ^1.0.5 => 1.0.5 gatsby-plugin-feed: ^3.0.0 => 3.0.0 gatsby-plugin-google-analytics: ^3.0.0 => 3.0.0 gatsby-plugin-google-tagmanager: ^3.0.0 => 3.0.0 gatsby-plugin-loadable-components-ssr: ^2.1.0 => 2.1.0 gatsby-plugin-manifest: ^3.0.0 => 3.0.0 gatsby-plugin-netlify: ^3.0.0 => 3.0.0 gatsby-plugin-netlify-cache: ^1.2.0 => 1.2.0 gatsby-plugin-react-helmet: ^4.0.0 => 4.0.0 gatsby-plugin-react-helmet-canonical-urls: ^1.4.0 => 1.4.0 gatsby-plugin-react-i18next: ^1.0.4 => 1.0.4 gatsby-plugin-react-svg: ^3.0.0 => 3.0.0 gatsby-plugin-resolve-src: ^2.1.0 => 2.1.0 gatsby-plugin-robots-txt: ^1.5.1 => 1.5.5 gatsby-plugin-sass: ^4.0.0 => 4.0.0 gatsby-plugin-sass-resources: ^2.0.0 => 2.0.0 gatsby-plugin-sharp: ^3.0.0 => 3.0.0 gatsby-plugin-sitemap: ^3.0.0 => 3.0.0 gatsby-plugin-split-css: ^1.0.2 => 1.0.2 gatsby-plugin-transition-link: ^1.18.0 => 1.20.5 gatsby-plugin-web-font-loader: ^1.0.4 => 1.0.4 gatsby-plugin-webpack-bundle-analyzer: ^1.0.5 => 1.0.5 gatsby-source-filesystem: ^3.0.0 => 3.0.0 gatsby-source-gravityforms: ^1.0.15 => 1.0.17 gatsby-source-wordpress: ^5.0.0 => 5.0.0 gatsby-transformer-sharp: ^3.0.0 => 3.0.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
TylerBarnescommented, Mar 29, 2021

For anyone who needs a workaround, you can add this to your plugin options:

{
  resolve: `gatsby-source-wordpress`,
  options: {
    type: {
      BlockEditorContentNode: { exclude: true }
    }
  }
}
1reaction
LekoArtscommented, Mar 26, 2021

I’m afraid that this is an upstream issue tracked here: https://github.com/pristas-peter/wp-graphql-gutenberg/issues/89

One thing you could try (this is untested):

In your gatsby-node.js:

exports.createSchemaCustomization = ({ actions }) => {
  const { createTypes } = actions

  createTypes(`
    interface WpBlockEditorContentNode implements Node {
      id: ID!
    }
  `)
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating to GatsbyJS v3, strange error from gatsby-source ...
The problem stemmed from a conflict between my gatsby-source-wordpress and the way my Polylang WP plugin gets exposed to the GraphQL API.
Read more >
Migrating from v2 to v3 - Gatsby
This is because the plugin needs to update its peerDependencies to include the new version of Gatsby (see section for plugin maintainers). While...
Read more >
Need help with Gatsby and WP : r/gatsbyjs - Reddit
I'm trying to migrate Gatsby from v2 to v3. I was just done migrating gatsby-source-wordpress to the latest (v5). When I do a...
Read more >
Migrate to gatsby-source-prismic - Documentation
How to migrate · 1. Install the new plugin · 2. Update the plugin configuration · 3. Refactor your queries · 4. Create...
Read more >
magecom/gatsby-source-wordpress-experimental-fork-media-items-fix
We're currently publishing on a separate package to make migrating from gatsby-source-wordpress@v3 easier. If you're coming from v3 ​this allows you to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found