TypeError: data.allFile.edges.node is undefined #28514
Unanswered
santhoshnumberone
asked this question in
Help
Replies: 1 comment 1 reply
-
-const imageData = data.allFile.edges.node.childImageSharp.fluid
+const imageData = data.allFile.edges[0].node.childImageSharp.fluid But also keep in mind that it will only work if you have a matching file. If you are not sure this will be a safer bet: const imageData = data.allFile.edges[0]?.node?.childImageSharp?.fluid But don't forget to double-check that |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Trying to set the background of div by following this link
https://www.gatsbyjs.com/plugins/gatsby-background-image/
This is the documented query on the link
I used this query as I could find desktop
Now I'm getting this error at this location
with this specific error inside
app.js
Could anyone give me please?
Beta Was this translation helpful? Give feedback.
All reactions