gatsby: Fails in dev environment @ createSchemaCustomization

For the past few days this issue has been preventing me from making changes to our code. I will not use the code from my repo as it is private but I have replicated this via the Gatsby WordPress tutorial and encountered the exact same problem.

Specification of plugins:

  • WP Gatsby 0.9.1
  • WP GraphQL 1.1.1
  • gatsby-source-wordpress-experimental 6.2.0
  • WP 5.6

Once I’ve updated gatsby-config.js I run gatsby develop and encounter the following issue:

warn Warning: there are unknown plugin options for "gatsby-source-wordpress-experimental": protocol,
restApiRoutePrefix, hostingWPCOM, useACF
success load plugins - 0.871s
success onPreInit - 0.034s
success initialize cache - 0.019s
success copy gatsby files - 0.062s
success onPreBootstrap - 0.017s
success  gatsby-source-wordpress  ensuring plugin requirements are met - 2.294s
⠀
info  gatsby-source-wordpress

	This is either your first build or the cache was cleared.
	Please wait while your WordPress data is synced to your Gatsby cache.

	Maybe now's a good time to get up and stretch? :D

success  gatsby-source-wordpress  ingest WPGraphQL schema - 2.367s

 ERROR

There was an error

not finished createSchemaCustomization - 4.703s

As you can see the error provides no feedback on what could be causing this problem. Please can you help me address this issue?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 16 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Heyo, @TylerBarnes is there anything else you need from the community in terms of reproduction?

Curious because this issue is preventing myself (and others) from upgrading to gatsby-souce-wordpress@v4 which was just released.

I just tried this morning with the latest packages. But no bueno. Here’s some more info:

Gatsby info

System:
    OS: Linux 4.4 Ubuntu 16.04.4
    CPU: (12) x64      [Prefer not to say]
    Shell: 4.3.48 - /bin/bash
  Binaries:
    Node: 14.15.4 - ~/.nvm/versions/node/v14.15.4/bin/node       
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.11 - ~/.nvm/versions/node/v14.15.4/bin/npm
  Languages:
    Python: 2.7.12 - /usr/bin/python
  Browsers:
    Chrome: 75.0.3770.100
  npmPackages:
    gatsby: ^2.30.2 => 2.32.3
    gatsby-cli: ^2.17.1 => 2.19.1
    gatsby-image: ^2.9.0 => 2.11.0
    gatsby-plugin-feed: ^2.11.0 => 2.13.0
    gatsby-plugin-manifest: ^2.10.0 => 2.12.0
    gatsby-plugin-material-ui: ^2.1.10 => 2.1.10
    gatsby-plugin-playground: ^1.0.6 => 1.0.6
    gatsby-plugin-postcss: ^3.5.0 => 3.7.0
    gatsby-plugin-react-helmet: ^3.8.0 => 3.10.0
    gatsby-plugin-robots-txt: ^1.5.5 => 1.5.5
    gatsby-plugin-sass: ^2.7.0 => 2.8.0
    gatsby-plugin-sharp: ^2.12.1 => 2.14.1
    gatsby-plugin-sitemap: ^2.10.0 => 2.12.0
    gatsby-source-filesystem: ^2.9.0 => 2.11.0
    gatsby-source-graphql: ^2.12.0 => 2.14.0
    gatsby-source-wordpress: ^4.0.1 => 4.0.1
    gatsby-transformer-sharp: ^2.10.1 => 2.12.0
  npmGlobalPackages:
    gatsby-cli: 2.19.1

WordPress Plugins

Gutenberg: 9.9.1 WP Gatsby: 1.0.1 WP GraphQL: 1.1.3 WPGraphQL Custom Post Type UI: 1.1 WPGraphQL for Advanced Custom Fields: 0.3.4 WPGraphQL WPML: 0.0.1 WordPress Version: 5.6.1

Build Error

gatsby clean; gatsby develop --verbose

success  gatsby-source-wordpress  ensuring plugin requirements are met - 10.775s
⠀
info  gatsby-source-wordpress 

        This is either your first build or the cache was cleared.
        Please wait while your WordPress data is synced to your Gatsby cache.

        Maybe now's a good time to get up and stretch? :D

success  gatsby-source-wordpress  writing GraphQL queries to disk at ./WordPress/GraphQL/ - 0.310s
success  gatsby-source-wordpress  ingest WPGraphQL schema - 7.549s

 ERROR 

There was an error

not finished createSchemaCustomization - 18.419s

sarah-PC:/mnt/c/my-gatsby-site$ 

Had the same problem but with : gatsby-source-wordpress-experimental: ^7.0.0, WP GraphQL: v1.1.2

Downgraded to: gatsby-source-wordpress-experimental: ^6.0.0, WP GraphQL: v1.0.5 (as suggested by @AdrianLuk )

and it’s working again for me 🎉

EDIT: these versions of gatsby-source-wordpress-experimental: ^6.0.0, WP GraphQL: v1.0.5 only work for me on a gatsby develop. Still getting issues with gatsby build

some other plugins I have installed in WP that remained untouched: WP Gatsby: v0.9.1 WPGraphQL Custom Post Type UI: v1.1 WPGraphQL for Advanced Custom Fields: v0.3.4 WPGraphQL WPML: v0.0.1

Awesome! @TylerBarnes love to see this!

A workaround for this issue temporarily is using my patched starter:

% gatsby new my-gatsby-blog-site https://github.com/lwz7512/gatsby-starter-wordpress-blog

This starter is a fork version of official Wordpress blog starter which includes a patch script fix-gsw.js:

"postinstall": "node ./fix-gsw.js",

Enjoy!

I figured it out!

There is a null value of transformedFields in build-types.js on line 128. So, to fix this bug, null check is required:

  if (!transformedFields || !Object.keys(transformedFields).length) {
    return;
  }

@TylerBarnes @AdrianLuk Is it not possible to explicitly state the reliance/dependency on WP related plugins in the tutorials because I used this as a de facto starting point.

Since this wasn’t the first instance of my technical issues - not solely due to this plugin, but a part was played - I’ve begun looking at alternative CMSs which unfortunately means I will be abandoning WP and this plugin (perhaps temporarily, perhaps not) due to my development experience.

I do believe an up-to-date version of the documentation detailing specific requirements on both ends could have thwarted me from taking a step back and giving my options a thorough investigation.

Had the same problem but with : gatsby-source-wordpress-experimental: ^7.0.0, WP GraphQL: v1.1.2

Downgraded to: gatsby-source-wordpress-experimental: ^6.0.0, WP GraphQL: v1.0.5 (as suggested by @AdrianLuk )

and it’s working again for me 🎉

I can confirm that rolling back to previous versions worked for me too 🔥

I’ve discovered the issue is WP Graphql 1.1.1…downgrading to 1.0.5 for now fixes it for me