Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails in dev environment @ createSchemaCustomization #29535

Closed
RobinSJames opened this issue Jan 9, 2021 · 16 comments
Closed

Fails in dev environment @ createSchemaCustomization #29535

RobinSJames opened this issue Jan 9, 2021 · 16 comments
Labels
topic: source-wordpress Related to Gatsby's integration with WordPress

Comments

@RobinSJames
Copy link

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?

@AdrianLuk
Copy link

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

@TylerBarnes
Copy link
Contributor

Hi @RobinSJames can you share your simple reproduction you made as well as the output of running gatsby info in the project directory? That will help us figure out what's going on.

Thanks!

@sarahannnicholson
Copy link
Contributor

sarahannnicholson commented Jan 14, 2021

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

@TylerBarnes
Copy link
Contributor

Hi @sarahannnicholson , thanks for sharing that! If you're able to share the output of gatsby info in the project directory that would help a lot :)

Thanks

@sarahannnicholson
Copy link
Contributor

Hey @TylerBarnes, here it is:

gatsby info

System:
OS: Linux 4.4 Ubuntu 18.04.2 LTS (Bionic Beaver)
CPU: [Rather not say]
Shell: 4.4.19 - /bin/bash
Binaries:
Node: 14.15.1 - ~/.nvm/versions/node/v14.15.1/bin/node
Yarn: 1.15.2 - /mnt/c/Program Files (x86)/Yarn/bin/yarn
npm: 6.14.11 - ~/.nvm/versions/node/v14.15.1/bin/npm
Languages:
Python: 2.7.15+ - /usr/bin/python
npmPackages:
gatsby: ^2.27.4 => 2.28.0
gatsby-cli: ^2.16.1 => 2.16.1
gatsby-image: ^2.6.0 => 2.7.0
gatsby-plugin-feed: ^2.8.0 => 2.9.0
gatsby-plugin-manifest: ^2.7.0 => 2.8.0
gatsby-plugin-material-ui: ^2.1.10 => 2.1.10
gatsby-plugin-postcss: ^3.2.0 => 3.3.0
gatsby-plugin-react-helmet: ^3.5.0 => 3.6.0
gatsby-plugin-robots-txt: ^1.5.3 => 1.5.3
gatsby-plugin-sass: ^2.7.0 => 2.7.0
gatsby-plugin-sharp: ^2.9.1 => 2.10.0
gatsby-plugin-sitemap: ^2.7.0 => 2.8.0
gatsby-source-filesystem: ^2.6.1 => 2.7.0
gatsby-source-graphql: ^2.9.0 => 2.10.0
gatsby-source-wordpress-experimental: ^7.0.0 => 7.0.0
gatsby-transformer-sharp: ^2.7.0 => 2.8.0
npmGlobalPackages:
gatsby-cli: 2.17.1

@RobinSJames
Copy link
Author

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 🔥

@RobinSJames
Copy link
Author

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

@AdrianLuk
Copy link

Hi @TylerBarnes this is still an issue.

My gatsby info output is as follows

System:
    OS: Windows 10 10.0.19042
    CPU: (32) x64 AMD Ryzen 9 3950X 16-Core Processor
  Binaries:
    Node: 14.15.4 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.10 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.423.0), Chromium (87.0.664.75)
  npmPackages:
    gatsby: ^2.31.1 => 2.31.1
    gatsby-background-image: ^1.4.0 => 1.4.0
    gatsby-image: ^2.10.0 => 2.10.0
    gatsby-plugin-canonical-urls: ^2.9.0 => 2.9.0
    gatsby-plugin-emotion: ^5.3.0 => 5.3.0
    gatsby-plugin-google-analytics: ^2.10.0 => 2.10.0
    gatsby-plugin-google-tagmanager: ^2.10.0 => 2.10.0
    gatsby-plugin-manifest: ^2.11.0 => 2.11.0
    gatsby-plugin-netlify: ^2.10.0 => 2.10.0
    gatsby-plugin-offline: ^3.9.0 => 3.9.0
    gatsby-plugin-react-helmet: ^3.9.0 => 3.9.0
    gatsby-plugin-react-svg: ^3.0.0 => 3.0.0
    gatsby-plugin-sass: ^3.1.0 => 3.1.0
    gatsby-plugin-sharp: ^2.13.1 => 2.13.1
    gatsby-plugin-transition-link: ^1.20.5 => 1.20.5
    gatsby-source-filesystem: ^2.10.0 => 2.10.0
    gatsby-source-wordpress-experimental: ^7.0.3 => 7.0.3
    gatsby-transformer-sharp: ^2.11.0 => 2.11.0
  npmGlobalPackages:
    gatsby-cli: 2.18.0

WP Plugins are as follows:

WP Gatsby: 0.9.2
WP GraphQL: 1.1.3
WPGraphQL Custom Post Type UI: 1.1
WPGraphQL for Advanced Custom Fields: 0.3.5
Add WPGraphQL SEO: 4.11.0

Output of gatsby develop is

$ gatsby develop
success open and validate gatsby-configs - 0.103s
success load plugins - 1.254s
success onPreInit - 0.031s
success initialize cache - 0.012s
success copy gatsby files - 0.149s
success onPreBootstrap - 0.017s
success  gatsby-source-wordpress  ensuring plugin requirements are met - 0.622s
⠀
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 - 0.885s

 ERROR 

There was an error

not finished createSchemaCustomization - 1.557s

Please let me know if you require anymore information in order to reproduce.
I've stated above that downgrading to gatsby-source-wordpress-experimental: ^6.1.1 and WPGraphQL to 1.0.5 fixes the develop process for me.

@RGBearMD
Copy link

RGBearMD commented Feb 9, 2021

Same problem with "gatsby develop" and "build" on a fresh new app, here is my output:

success open and validate gatsby-configs - 0.084s
success load plugins - 3.487s
success onPreInit - 0.031s
success initialize cache - 0.014s
success copy gatsby files - 0.079s
success onPreBootstrap - 0.015s
success  gatsby-source-wordpress  ensuring plugin requirements are met - 2.983s
⠀
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.029s

 ERROR 

There was an error

not finished createSchemaCustomization - 5.048s

@sarahannnicholson
Copy link
Contributor

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$ 

@jonlow
Copy link
Contributor

jonlow commented Feb 10, 2021

Can confirm that I'm also getting this error with same plugin versions as @sarahannnicholson

@jackonawalk jackonawalk transferred this issue from gatsbyjs/gatsby-source-wordpress-experimental Feb 16, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 16, 2021
@jackonawalk jackonawalk added topic: source-wordpress Related to Gatsby's integration with WordPress and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Feb 16, 2021
@lwz7512
Copy link
Contributor

lwz7512 commented Feb 16, 2021

The same error: not finished createSchemaCustomization - occurred with the latest plugins.

my configuration:

  • gatsby-source-wordpress: ^4.0.0 => 4.0.1
  • WP Gatsby version 1.0.1
  • WP GraphQL version 1.1.3

The gatsby-source-wordpress options.url default value https://wpgatsbydemo.wpengine.com/graphql works well with above config, but when I changed it to my website graphql api: https://www.wp4speed.com/graphql, building process failed.

I'm curious about the 2 plugins(WP Gatsby, WP GraphQL) version in wpgatsbydemo.wpengine.com, anyone know this? @jacksellwood

@lwz7512
Copy link
Contributor

lwz7512 commented Feb 17, 2021

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;
  }

@lwz7512
Copy link
Contributor

lwz7512 commented Feb 17, 2021

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!

gatsbybot pushed a commit that referenced this issue Feb 23, 2021
#29554)

Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
ascorbic pushed a commit that referenced this issue Feb 23, 2021
#29554)

Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
(cherry picked from commit 308d418)
ascorbic added a commit that referenced this issue Feb 24, 2021
#29554) (#29712)

Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com>
(cherry picked from commit 308d418)

Co-authored-by: liwenzhi <lwz7512@gmail.com>
Co-authored-by: Matt Kane <matt@gatsbyjs.com>
@TylerBarnes
Copy link
Contributor

TylerBarnes commented Feb 24, 2021

This should be fixed as of gatsby-source-wordpress@4.0.3 - thanks @lwz7512 !

@lwz7512
Copy link
Contributor

lwz7512 commented Feb 25, 2021

Awesome! @TylerBarnes love to see this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: source-wordpress Related to Gatsby's integration with WordPress
Projects
None yet
Development

No branches or pull requests

8 participants