gatsby-source-wordpress: sometimes querying image works, sometimes doesn't

Created on 14 Apr 2019  路  5Comments  路  Source: gatsbyjs/gatsby

Description

While making a site using gatsby-source-wordpress I noticed that builds failed occasionally, with the error message error Cannot query field "localFile" on type "wordpress__PAGEAcfHero_image" graphql/template-strings

I've checked the sections in the docs with regard to issues querying images and null files, and have taken steps to address them (this one seems particularly relevant). But here's the kicker: This issue happens seemingly randomly. In other words, the image is certainly not null, and IS available, since it is being queried some of the time, but not at other times.

Steps to reproduce

Clone repo and run gatsby develop. It should not take many attempts to error out.

Expected result

A locally served version of the site should open, which should look like this

Actual result

Build fails, showing the line error Cannot query field "localFile" on type "wordpress__PAGEAcfHero_image" graphql/template-strings

Environment

System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz
Binaries:
Yarn: 1.10.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: 44.17763.1.0
npmPackages:
gatsby: ^2.3.21 => 2.3.21
gatsby-image: ^2.0.38 => 2.0.38
gatsby-plugin-emotion: ^4.0.6 => 4.0.6
gatsby-plugin-manifest: ^2.0.29 => 2.0.29
gatsby-plugin-offline: ^2.0.25 => 2.0.25
gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12
gatsby-plugin-sharp: ^2.0.34 => 2.0.34
gatsby-source-filesystem: ^2.0.29 => 2.0.29
gatsby-source-wordpress: ^3.0.53 => 3.0.53
gatsby-transformer-sharp: ^2.1.18 => 2.1.18

bug

Most helpful comment

I believe this is a Duplicate of #10347

All 5 comments

Replicated. Error occurred after second run of gatsby develop. It occurred once out of ten tries though.

Environment:
System: OS: Windows 10 CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz Binaries: Yarn: 1.7.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 6.2.0 - C:\Program Files\nodejs\npm.CMD Languages: Python: 2.7.15 Browsers: Edge: 44.17763.1.0 npmPackages: gatsby: ^2.3.21 => 2.3.21 gatsby-image: ^2.0.38 => 2.0.38 gatsby-plugin-emotion: ^4.0.6 => 4.0.6 gatsby-plugin-manifest: ^2.0.29 => 2.0.29 gatsby-plugin-offline: ^2.0.25 => 2.0.25 gatsby-plugin-react-helmet: ^3.0.12 => 3.0.12 gatsby-plugin-sharp: ^2.0.34 => 2.0.34 gatsby-source-filesystem: ^2.0.29 => 2.0.29 gatsby-source-wordpress: ^3.0.53 => 3.0.53 gatsby-transformer-sharp: ^2.1.18 => 2.1.18

@RikoSmith Thank you for trying it out! Good to know it isn't just something odd on my and Netlify's machines (the errors happen on Netlify too).

I believe this is a Duplicate of #10347

@hesselberg Yes, seems likely.

Duplicate of #10347

Thanks for opening this issue, let us move this discussion to #10347

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timbrandin picture timbrandin  路  3Comments

hobochild picture hobochild  路  3Comments

totsteps picture totsteps  路  3Comments

benstr picture benstr  路  3Comments

Oppenheimer1 picture Oppenheimer1  路  3Comments