gatsbyjs / gatsby

The best React-based framework with performance, scalability and security built in.
https://www.gatsbyjs.com
MIT License
55.28k stars 10.31k forks source link

gatsby-source-wordpress | createSchemaCustomization #29457

Closed PaulieScanlon closed 3 years ago

PaulieScanlon commented 3 years ago

Description

I'm having a play with gatsby-source-wordpress and have created a stripped back repo here

I've only added the deps i think i need after referencing the starter

But I'm seeing the following error:

success  gatsby-source-wordpress  ensuring plugin requirements are met - 0.842s
⠀
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 - 1.136s

 ERROR

There was an error

not finished createSchemaCustomization - 2.007s

Steps to reproduce

I have WP running on wordpress.com and my graphql endpoint url is https://pauliepro.blog/graphql.. maybe it's something i've done wrong in WP?

If i use the url from the starter https://wpgatsbydemo.wpengine.com/graphql this repro repo works ok. However the starter errors when i use my url, which makes me think it's something to do with how i've setup WP rather than a problem with the source plugin.

I've added the following plugins to WP

WP Gatsby Version 1.0.1 

WP GraphQL Version 1.1.3

but when i run... yarn develop | gatsby develop i see an error

Expected result

I was hoping the site would build

Actual result

ERROR

Environment

  System:
    OS: macOS Mojave 10.14.5
    CPU: (8) x64 Intel(R) Core(TM) i7-8569U CPU @ 2.80GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.16.1 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.13.4 - /usr/local/bin/npm
  Languages:
    Python: 2.7.10 - /usr/bin/python
  Browsers:
    Chrome: 88.0.4324.150
    Firefox: 85.0
    Safari: 13.1.1
  npmPackages:
    gatsby: ^2.30.1 => 2.32.3
    gatsby-plugin-sharp: ^2.14.1 => 2.14.1
    gatsby-source-wordpress: ^4.0.1 => 4.0.1
    gatsby-transformer-sharp: ^2.12.0 => 2.12.0
  npmGlobalPackages:
    gatsby-cli: 2.15.1
PaulieScanlon commented 3 years ago

For anyone else running into weird errors. In my case it was caused by CoBlocks I deactivated this plugin and everything sprung back to life. Feel free to close this issue.

TylerBarnes commented 3 years ago

Interesting :thinking: if you don't mind I'm going to keep it open so I remember to investigate this. Other people have been running into this problem and the error here is very bad. I think the error comes from Gatsby core but it's expecting the WP plugin to provide an error somewhere. So we definitely need to improve this.

PaulieScanlon commented 3 years ago

Hey @TylerBarnes TY for the response. Yeah it was a weird one this. I suppose such is the way with emerging tech. It's great though and really nice job!

If there is an opportunity to surface the actual error that would be helpful as debugging this was a case of trial and error and i imagine in an existing WP project it might not be feasible to disable plugins to find the root cause.

Onwards 💪

AdrianLuk commented 3 years ago

https://github.com/gatsbyjs/gatsby-source-wordpress-experimental/issues/410

This issue is also mentioned here if anyone is looking for references to other people running into the same issue

jackonawalk commented 3 years ago

Closing this duplicate. See issue: https://github.com/gatsbyjs/gatsby/issues/29535