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

fix(gatsby): fallback for non-existing config #13948

Merged
merged 1 commit into from
May 9, 2019
Merged

fix(gatsby): fallback for non-existing config #13948

merged 1 commit into from
May 9, 2019

Conversation

thomascorthouts
Copy link
Contributor

This is a proposed way of doing it, I would love to have feedback or a conversation on how to fix/address this in a more Gatsby way.

Description

I found that with changing from Gatsby v2.3.36 to v2.4.2, a Gatsby website would not be able to be served using gatsby serve when there is no gatsby-config.js file in the root folder of the project. This was due to the destructuring on line 72 in the gatsby/src/commands/serve.js file, which threw a TypeError when the command tried to destructure from undefined.

I tried to solve this error by having a fallback to an empty object. But another (and maybe better) approach could also be that it is clearly documented as a needed file in the structure and to add it to the gatsby-starter-hello-world Starter project.

Related Issues

This issue was addressed in #13910

@thomascorthouts thomascorthouts requested a review from a team as a code owner May 9, 2019 15:58
@thomascorthouts
Copy link
Contributor Author

Follow-up question: Would it make sense to have regression tests whether the starters keep on working after updates?

@m-allanson m-allanson changed the title chore: fallback for non-existing config fix(gatsby): fallback for non-existing config May 9, 2019
Copy link
Contributor

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @thomascorthouts, this is a good fix 👍

@m-allanson m-allanson merged commit 2f8f170 into gatsbyjs:master May 9, 2019
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

Successfully merging this pull request may close these issues.

2 participants