Skip to content
New issue

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

[gatsby-source-filesystem] Validate the existence of path in options property #2806

Closed
shri3k opened this issue Nov 6, 2017 · 0 comments
Closed

Comments

@shri3k
Copy link

shri3k commented Nov 6, 2017

While specifying path in gatsby-config.js validate the path and let the user know if it doesn't exist instead of failing quietly

e.g.

module.exports = {
  siteMetadata: {
    title: `Pandas Eating Lots`,
  },
  plugins: [
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `src`,
        path: `${__dirname}/src/some_path`, // some_path doesn't exist
      },
    },
  ],
}
> gatsby develop

Everything feels like it's working so far but in GraphiQL we find that allFile query will fail indicating something's not right.

I think it'd be helpful to let the user know that the path is invalid while (re)building but will defer to the team on what the right solution should be.

singuerinc added a commit to singuerinc/gatsby that referenced this issue Nov 7, 2017
* upstream/master: (156 commits)
  Publish new version
  Publish
  use peer reps (gatsbyjs#2832)
  escape pipe in markdown (gatsbyjs#2835)
  Publish
  Small, perhaps nitpicky, change but not explicitly stating which file this config was referencing tripped up the flow for me for a bit when running through step-by-step. (gatsbyjs#2834)
  Fix no trailing slashes (gatsbyjs#2828)
  Publish
  Update to the latest Prettier
  Small fixes to tutorial part one (gatsbyjs#2821)
  Revert "Fix: only the first feed was getting options.query injected. Now all the feeds have it injected. (gatsbyjs#2571)" (gatsbyjs#2820)
  Revert "Added the ability to customize the feed's title (gatsbyjs#2573)" (gatsbyjs#2822)
  keep track of root node id with weakmap instead of storing root node id as additional field in sub nodes (gatsbyjs#2812)
  Publish
  Add onLoad prop to gatsby-image (gatsbyjs#2818)
  Add post "Migrate from Hugo to Gatsby" (gatsbyjs#2808)
  Update readme showcase so that source links are distinct (gatsbyjs#2815)
  Publish
  Add Softin Sistemas' website into Showcase (gatsbyjs#2793)
  Validate that gatsby-source-filesystem paths exist fixes gatsbyjs#2806 (gatsbyjs#2813)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant