-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Changing gatsby-config to export a function breaks filesystem #16013
Comments
Hi Alex! Exporting a function from If so -- you'll want to check out some of the theme documentation, which will give a bit more detail. In general -- an app/site uses a theme (which can export a function) as a plugin. Hope this helps -- let us know if we can provide more detail! |
Thanks for the prompt response! Yes, this is a theme built using @jlengstorf's course. What I'm gathering is once my theme is exporting its config as a function I can no longer test data locally within the theme folder - at that point I must use a secondary workspace to develop, correct? |
Once your theme uses |
Sounds like this is intended functionality. If that is the case feel free to close the issue. I will say, it's not a very intuitive developer experience. Couldn't the theme accept the original data source and allow the theme consumer to override the data directory? What if I want to pre-populate my theme with data? |
If you really want to launch the theme in a standalone mode, you can imagine something like this:
|
@karatechops @andihaki this is the expected behavior, yes. I don't call it out strongly enough in the egghead course, but the command switches to I'm going to close this because this is expected behavior, but please feel free to follow up with questions! |
Description
When changing my
gatsby-config.js
to export a function rather than an object my data disappears from graphql queries.Steps to reproduce
I am running the Node v10.16.0 on with the following project dependencies:
Here is what the working config looks like -
With the above config my data populates correctly in graphql. When this config file is adjusted to the following my graphql queries are empty.
Expected result
Exporting an object or a function returning an object should behave the same.
Actual result
My data breaks when exporting a function implicitly returning an object.
Environment
The text was updated successfully, but these errors were encountered: