We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to createpages. It works when I use gatsby develop but it fails when I use gatsby build
const Project = ({ data }) => { 34 | const post = data.markdownRemark; > 35 | const featuredImgFluid = post.frontmatter.featuredImage.childImageSharp.fluid; | ^ 36 | return ( 37 | <Layout> 38 | <Container> WebpackError: TypeError: Cannot read property 'childImageSharp' of null - project.js:35 Project src/templates/project.js:35:59 - gatsby-ssr.js:14 Module.replaceRenderer gatsby-ssr.js:14:40 exports.onCreateNode = ({ node, getNode, actions }) => { const { createNodeField } = actions; if (node.internal.type === 'MarkdownRemark') { const slug = createFilePath({ node, getNode, basePath: 'content' }); createNodeField({ node, name: `slug`, value: slug, }); } }; exports.createPages = async ({ graphql, actions }) => { const { createPage } = actions; const result = await graphql(` query { allMarkdownRemark { edges { node { fields { slug } } } } } `); result.data.allMarkdownRemark.edges.forEach(({ node }) => { createPage({ path: node.fields.slug, component: path.resolve(`./src/templates/project.js`), context: { // Data passed to context is available // in page queries as GraphQL variables. slug: node.fields.slug, }, }); }); };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm trying to createpages. It works when I use gatsby develop but it fails when I use gatsby build
The text was updated successfully, but these errors were encountered: