title: Gatsby Create Pages
body: <p>I am trying to create a gatsby site where I have projects posted, each with tags. I followed a basic tutorial on creating a gatsby blog, and am now working through gatsby's tags as documented on their website. Along the way while changing variable names from path to slug to avoid reserved words, I seem to have messed up because I can no longer create blogpost pages, nor tag pages. Each post is enclosed in a folder named by the post title, holding an index.md file defining its content, date, tag etc.</p>
  <p>The following error is output when I try to run gatsby develop,</p>
  <p><strong>ERROR #11323</strong></p>
  <pre><code>Your site's &quot;gatsby-node.js&quot; must set the page path when creating a page.
  
  The page object passed to createPage:
  {
      &quot;slug&quot;: &quot;/an-example-post&quot;,
      &quot;component&quot;: &quot;C:\\Users\\Monolith\\Documents\\programming\\webdev\\Gatsby-Portfolio\\src\\templates\\post.js&quot;,
      &quot;context&quot;: {
          &quot;slug&quot;: &quot;/an-example-post&quot;
      }
  }
  </code></pre>
  <p>My gatsby-node.js</p>
  <pre><code>const path = require('path');
  
  exports.createPages = ({actions, graphql}) =&gt; {
       const {createPage} = actions;
  
       const postTemplate = path.resolve('src/templates/post.js');
       const tagTemplate = path.resolve(&quot;src/templates/tags.js&quot;)
       //const postTemplate = require.resolve('src/templates/post.js');
       //const tagTemplate = require.resolve(&quot;src/templates/tags.js&quot;)
       
       return graphql(`{
          allMarkdownRemark{
              edges{
                  node {
                      html
                      id
                      frontmatter{
                          slug
                          title
                      }
                  }
              }
          }
      
          tagsGroup: allMarkdownRemark(limit: 2000) {
              group(field: frontmatter___tags) {
                fieldValue
              }
            }
  
      }`)
      .then(res =&gt; {
          if(res.errors){
              return Promise.reject(res.errors);
          }
  
  
          
          res.data.allMarkdownRemark.edges.forEach( ({node}) =&gt; {
              createPage({
                  slug: node.frontmatter.slug,
                  component: postTemplate,
                  context: {
                      slug:node.frontmatter.slug
                  },
              })
          })
  
            // Extract tag data from query
          const tags = res.data.tagsGroup.group
  
          // Make tag pages
          tags.forEach(tag =&gt; {
              createPage({
                  // path: `/tags/${_.kebabCase(tag.fieldValue)}/`,
                  slug: `/tags/${(tag.fieldValue)}/`,
                  component: tagTemplate,
                  context: {
                      tag: tag.fieldValue,
                  },
              })
          })
  
      }) 
  }
  </code></pre>
  <p>As previously mentioned I was concerned the path variable being a reserved word could be an issue, but I got further using it than omitting it so for now it has stayed.</p>
  <p>Example post.js</p>
  <pre><code>import React from 'react';
  import { graphql } from 'gatsby';
  import Layout from &quot;../components/layout&quot;
  
  export default function Template({data}) {
      const {markdownRemark: post} = data;
  
      return(
          &lt;Layout&gt;
          &lt;div&gt;
              &lt;h1 className=&quot;postTitle&quot;&gt;{post.frontmatter.title}&lt;/h1&gt;
              &lt;div className=&quot;tagGroup&quot;&gt;
                  {post.frontmatter.tags.map((tag, index) =&gt; (
                      &lt;div key={index}&gt;
                          &lt;h2 className = &quot;tagStyle&quot;&gt;{tag}&lt;/h2&gt;
                      &lt;/div&gt;
                  ))}
              &lt;/div&gt;
              &lt;p&gt;{post.frontmatter.description}&lt;/p&gt;
              &lt;p&gt;{post.frontmatter.date}&lt;/p&gt;            
              {/* &lt;h2 className=&quot;tagStyle&quot;&gt;{post.frontmatter.tags + &quot; &quot;}&lt;/h2&gt; */}
              &lt;div dangerouslySetInnerHTML={{__html: post.html}} /&gt;
          &lt;/div&gt;
          &lt;/Layout&gt;
      )
  }
  
  
  export const postQuery = graphql`
      #query BlogPostByPath($slug: String!) {
      query($slug: String!) {
          markdownRemark(frontmatter: { slug: {eq: $slug} }) {
              html
              frontmatter {
                  slug
                  title
                  description
                  date
                  tags
              }
          }
      }
  `
  </code></pre>
  <p>The tags.js is very similar to gatsby's default with slight alterations for content. Here is the Graphql query I am using.</p>
  <pre><code>Tags.propTypes = {
    pageContext: PropTypes.shape({
      tag: PropTypes.string.isRequired,
    }),
    data: PropTypes.shape({
      allMarkdownRemark: PropTypes.shape({
        totalCount: PropTypes.number.isRequired,
        edges: PropTypes.arrayOf(
          PropTypes.shape({
            node: PropTypes.shape({
              frontmatter: PropTypes.shape({
                title: PropTypes.string.isRequired,
             //   slug: PropTypes.string.isRequired,
              }),
              fields: PropTypes.shape({
                slug: PropTypes.string.isRequired,
              }),
            }),
          }).isRequired
        ),
      }),
    }),
  }
  
  export default Tags
  
  export const pageQuery = graphql`
    query($tag: String) {
      allMarkdownRemark(
        limit: 2000
        sort: { fields: [frontmatter___date], order: DESC }
        filter: { frontmatter: { tags: { in: [$tag] } } }
      ) {
        totalCount
        edges {
          node {
             fields {
               slug
             }
            frontmatter {
              title
            }
          }
        }
      }
    }
  `
  </code></pre>
  <p>If anyone has any information to help point me in the right direction I would greatly appreciate it. I have been running through gatsby's documentation for hours and have yet to make substantial progress.</p>