Closed iTonyYo closed 6 years ago
@iTonyYo did you check the GraphiQL (http://localhost:8000/___graphql) to see if the query is ok?
When you run gatsby develop
and access the page where the query is did you see any error in the console?
There's no error in the console.
And, the page can be displayed normally.
@LuisLoureiro
Is it possible have a reproduction repo of the issue?
Seems related to #7597, would be great to have a minimal reproduction of the error @iTonyYo. 🙏
Thre 💥reproduction repo 💥 is here.
System:
OS: macOS High Sierra 10.13.5
CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Shell: 5.3 - /bin/zsh
Binaries:
Node: 8.11.4 - ~/.nvm/versions/node/v8.11.4/bin/node
Yarn: 1.9.4 - /usr/local/bin/yarn
npm: 6.4.0 - ~/.nvm/versions/node/v8.11.4/bin/npm
Browsers:
Chrome: 68.0.3440.106
Safari: 11.1.1
npmPackages:
gatsby: ^1.9.277 => 1.9.277
gatsby-link: ^1.6.46 => 1.6.46
gatsby-plugin-catch-links: ^1.0.24 => 1.0.24
gatsby-plugin-feed: ^1.3.25 => 1.3.25
gatsby-plugin-google-analytics: ^1.0.31 => 1.0.31
gatsby-plugin-google-fonts: latest => 0.0.4
gatsby-plugin-offline: ^1.0.18 => 1.0.18
gatsby-plugin-postcss-sass: ^1.0.22 => 1.0.22
gatsby-plugin-react-helmet: ^2.0.11 => 2.0.11
gatsby-plugin-sharp: ^1.6.48 => 1.6.48
gatsby-plugin-sitemap: ^1.2.25 => 1.2.25
gatsby-remark-copy-linked-files: ^1.5.37 => 1.5.37
gatsby-remark-images: ^1.5.67 => 1.5.67
gatsby-remark-prismjs: ^2.0.5 => 2.0.5
gatsby-remark-responsive-iframe: ^1.4.20 => 1.4.20
gatsby-remark-smartypants: ^1.4.12 => 1.4.12
gatsby-source-filesystem: ^1.5.39 => 1.5.39
gatsby-transformer-remark: ^1.7.44 => 1.7.44
gatsby-transformer-sharp: ^1.6.27 => 1.6.27
npmGlobalPackages:
gatsby-cli: 1.1.58
@tryzniak @Chuloo
Maybe I found the problem. Many web pages using coverImage.ChildImageSharp
. But only one page defines coverImage
. I mean graphql query.
@tryzniak @Chuloo @LuisLoureiro
My problem has been solved. Successfully performed gatsby build
. 😃
@tryzniak @Chuloo @LuisLoureiro
Hey @iTonyYo Can you please share, how did you solve this error?
It's working when
gatsby develop
.But when
gatsby build
,WebpackError: Cannot read property 'childImageSharp' of undefined.
if,
then,
Graphql Query,
Dependencies,