Search code examples
reactjsgatsby

Gatsby 3 "Path" argument must be of type string


I'm attempting to upgrade from Gatsby 2 to 3. I removed all dependencies from package.json and installed Gatsby. I'm currently trying to run gatsby develop, but I get the error:

'The "path" argument must be of type string. Received an instance of Object'

Any idea how to get around this? I'm not sure what all I need to share, but here's my gatsby-config.js.

// Gatsby-config.js
module.exports = {
  siteMetadata,
  plugins: [
    {
      resolve: `gatsby-plugin-mdx`,
      options: {
        [],
        extensions: [`.mdx`, `.md`]
      }
    },
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `Tyler's Blog`,
        short_name: `TylersBlog`,
        start_url: `/`,
        background_color: `#ffffff`,
        theme_color: `#663399`,
        display: `standalone`,
        icon: `content/favicon.svg`,
      },
    },
  ],
}


Solution

  • Remove your package-lock.json and generate it again by npm install. Run a gatsby clean after that.

    In addition, without knowing the siteMetadata object structure it's difficult to guess if there's something wrong there but maybe your need to:

    // Gatsby-config.js
    module.exports = {
      siteMetadata.siteMetadata,
      plugins: [
        {
          resolve: `gatsby-plugin-mdx`,
          options: {
            extensions: [`.mdx`, `.md`]
          }
        },
        {
          resolve: `gatsby-plugin-manifest`,
          options: {
            name: `Tyler's Blog`,
            short_name: `TylersBlog`,
            start_url: `/`,
            background_color: `#ffffff`,
            theme_color: `#663399`,
            display: `standalone`,
            icon: `content/favicon.svg`,
          },
        },
      ],
    }
    

    I've also removed the empty options array.