zgordon / twentynineteen-gatsby-theme

A port of the Twenty Nineteen WordPress Theme over to Gatsby
71 stars 23 forks source link

AhMazing. Also, confusing errors #10

Open Benunc opened 5 years ago

Benunc commented 5 years ago

First, thanks for this great resource for learning Gatsby and headless WordPress. I really appreciate it. It works flawlessly when I use the default WP URL.

When I switch the URL over to my existing WP site (with WPGraphQL already installed) and yarn workspace starter develop it chugs through all of the posts no problem, but then seems to choke on pages, specifically at the createPagesfetch page 1 of pages... portion of events.

Screen Shot 2019-04-16 at 8 17 34 AM

error Plugin gatsby-theme-twentynineteen returned an error

  TypeError: Cannot read property 'uri' of null

  - createPages.js:134 allPages.map.page
    .../twentynineteen-gatsby-theme/packages/gatsby-theme-twentynineteen/utils/createPages.js:134:43

  - Array.map

  - createPages.js:133 fetchPages.then.allPages
    .../twentynineteen-gatsby-theme/packages/gatsby-theme-twentynineteen/utils/createPages.js:133:16

I would assume that's because of either a protected post, or some corrupt data in my poor old database that has been through its share of abuse.

It then appears to continue to chug along for a few successful commands, before erroring out harder:

success createPages — 21.011 s
success createPagesStatefully — 0.074 s
success onPreExtractQueries — 0.001 s
success update schema — 0.531 s
warning There are conflicting field types in your data. GraphQL schema will omit those fields.
SitePage.context.categories.nodes[]:
 - type: object
   value: [Object: null prototype] { name: 'trinity', slug: 'trinity' }
   source: c55ab679-495e-5d92-9671-1c927e8b636b
SitePage.context.prev.categories.nodes[]:
 - type: object
   value: [Object: null prototype] { name: 'trinity', slug: 'trinity' }
   source: c55ab679-495e-5d92-9671-1c927e8b636b
SitePage.context.next.categories.nodes[]:
 - type: object
   value: [Object: null prototype] { name: 'trinity', slug: 'trinity' }
   source: c55ab679-495e-5d92-9671-1c927e8b636b
SitePage.context.nodes[].categories.nodes[]:
 - type: object
   value: [Object: null prototype] { name: 'trinity', slug: 'trinity' }
   source: c55ab679-495e-5d92-9671-1c927e8b636b
error Type categories must define one or more fields.

Type categories_2 must define one or more fields.

Type categories_3 must define one or more fields.

Type categories_4 must define one or more fields.

  Error: Type categories must define one or more fields.
  Type categories_2 must define one or more fields.
  Type categories_3 must define one or more fields.
  Type categories_4 must define one or more fields.

It sputters once or twice after that before fully failing with

error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed.

Any help is appreciated.

Benunc commented 5 years ago

Is there a method of not importing categories? For the purposes of this test run, I am considering spinning up a new site and just importing posts and pages from my main install.

jasonbahl commented 5 years ago

@benunc what version of WPGraphQL are you on? And what url are you running the build against? I’ll see if I can get to the same point as you and see if I can help.

Benunc commented 5 years ago

@jasonbahl URL is https://benandjacq.com WPGraphQL 0.3.01

Thanks!

jasonbahl commented 5 years ago

Ok. Cool. I’ll try and look in a bit.