Gatsby: [gatsby-source-filesystem]: The path passed to gatsby-source-filesystem does not exist on your file system: undefined

Created on 11 Nov 2018  路  2Comments  路  Source: gatsbyjs/gatsby

Description

I am unable to build my application which was working absolutely fine like an hour ago. Running gatsby build doesn't work.

Steps to reproduce

I am providing my package.json and gatsby-config.js code so that one can have a better understanding of what version of packages I am using in my project (because that might be an issue according to me but i'm not sure).

gatsby-config.js

module.exports = { siteMetadata: { title: 'Prateek Gogia', }, plugins: [ 'gatsby-plugin-react-helmet', { resolve:gatsby-plugin-manifest, options: { name: 'Prateek Gogia', short_name: 'Prateek Gogia', start_url: '/', background_color: '#663399', theme_color: '#663399', display: 'minimal-ui', icon: 'src/images/favicon.jpeg', // This path is relative to the root of the site. }, }, { resolve:gatsby-plugin-google-analytics, options: { trackingId: 'UA-98325790-2', }, }, 'gatsby-plugin-offline', 'gatsby-plugin-sass', { resolve: 'gatsby-source-filesystem', options: [ { name:pages, path:${__dirname}/src/pages, ignore: [*/.], }, ], }, 'gatsby-transformer-remark', { resolve: 'gatsby-remark-copy-linked-files', options: { destinationDir: 'images', }, ignoreFileExtensions: [], }, 'gatsby-transformer-sharp', 'gatsby-plugin-sharp', ], }

package.json

{ "name": "reeversedev.github.io", "description": "Personal Website", "version": "1.0.0", "author": "Prateek Gogia <[email protected]>", "dependencies": { "@fortawesome/fontawesome-svg-core": "^1.2.8", "@fortawesome/free-brands-svg-icons": "^5.5.0", "@fortawesome/free-solid-svg-icons": "^5.5.0", "@fortawesome/react-fontawesome": "^0.1.3", "bootstrap": "^4.1.3", "gatsby": "^2.0.33", "gatsby-image": "^2.0.20", "gatsby-plugin-google-analytics": "^2.0.7", "gatsby-plugin-manifest": "^2.0.8", "gatsby-plugin-offline": "^2.0.13", "gatsby-plugin-react-helmet": "^3.0.1", "gatsby-plugin-sass": "^2.0.4", "gatsby-plugin-sharp": "^2.0.12", "gatsby-remark-copy-linked-files": "^2.0.6", "gatsby-source-filesystem": "^2.0.8", "gatsby-transformer-remark": "^2.1.12", "gatsby-transformer-sharp": "^2.1.8", "node-sass": "^4.10.0", "react": "^16.6.1", "react-bootstrap": "^0.32.4", "react-dom": "^16.6.1", "react-ga": "^2.5.3", "react-helmet": "^5.2.0" }, "keywords": [ "gatsby" ], "license": "MIT", "scripts": { "build": "gatsby build", "develop": "gatsby develop", "format": "prettier --write '**/*.js'", "test": "echo \"Error: no test specified\" && exit 1", "start": "gatsby develop" }, "devDependencies": { "prettier": "^1.15.2" }, "repository": { "type": "git", "url": "https://github.com/reeversedev/reeversedev/github.io" } }

Expected result

The application should be build successfully.

Actual result

I'm receiving this.

screenshot 2018-11-11 at 6 48 36 pm

Most helpful comment

Your gatsby-source-filesystem options are specified as an array:

{
  resolve: 'gatsby-source-filesystem',
  options: [ { 
    name: pages,
    path: ${__dirname}/src/pages,
    ignore: [**/.*],
   }, ],
}

Try specifying them without the array wrapper, as shown in the readme

{
  resolve: 'gatsby-source-filesystem', 
  options: { 
    name: pages,
    path: ${__dirname}/src/pages,
    ignore: [**/.*],
   },
}

All 2 comments

Your gatsby-source-filesystem options are specified as an array:

{
  resolve: 'gatsby-source-filesystem',
  options: [ { 
    name: pages,
    path: ${__dirname}/src/pages,
    ignore: [**/.*],
   }, ],
}

Try specifying them without the array wrapper, as shown in the readme

{
  resolve: 'gatsby-source-filesystem', 
  options: { 
    name: pages,
    path: ${__dirname}/src/pages,
    ignore: [**/.*],
   },
}

It works! Thanks, I think I was trying to resolve the two times but in a wrong way.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimfilippou picture jimfilippou  路  3Comments

timbrandin picture timbrandin  路  3Comments

brandonmp picture brandonmp  路  3Comments

andykais picture andykais  路  3Comments

hobochild picture hobochild  路  3Comments