aravindballa / gatsby-theme-andy

A Gatsby theme to build Andy style websites. 📑
343 stars 46 forks source link

Problems starting gatsby develop #9

Closed YangVincent closed 4 years ago

YangVincent commented 4 years ago

Hi,

It's my first time using Gatsby. I got this error, was wondering if you could help me understand why it might be happening.

I got this, but it had a GraphQL error when I used the config from the sandbox.

/home/aeonneo/gatsby-theme-andy/gatsby-config cannot export a function.

A gatsby-config exported as a Function can only be used as a theme and not run directly.
If you are trying to run a theme directly, use the theme in an example site or starter instead and run that site to test.
If you are in the root gatsby-config.js for your site, change the export to be an object and not a function as functions
are not supported in the root gatsby-config.

not finished open and validate gatsby-configs - 0.037s
YangVincent commented 4 years ago

It actually happens on the sandbox as well (the GraphQL error)

There was an error in your GraphQL query:

Cannot query field "inboundReferencePreviews" on type "BrainNote".

If you don't expect "inboundReferencePreviews" to exist on the type "BrainNote" it is most likely a typo.
However, if you expect "inboundReferencePreviews" to exist there are a couple of solutions to common problems:

- If you added a new data source and/or changed something inside gatsby-node.js/gatsby-config.js, please try a restart of your development server
- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which fields you can query and what shape they have
- You want to optionally use your field "inboundReferencePreviews" and right now it is not used anywhere. Therefore Gatsby can't infer the type and add it to the GraphQL schema. A quick fix is to add a least one entry with that field ("dummy content")

It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the mentioned "dummy content". Visit our docs to learn how you can define the schema for "BrainNote":
https://www.gatsbyjs.org/docs/schema-customization/#creating-type-definitions

File: /sandbox/node_modules/@aengusm/gatsby-theme-brain/src/templates/brain.js
aravindballa commented 4 years ago

Hey! Thanks for trying this out. Can I know what steps you took?

We can cannot run this directly as this is a gatsby theme and we need to include this in a gatsby project as a plugin. Also, I ran into an issue, where this project wouldn't build if the markdown file in the content doesn't have [[]] (this is a bug).

YangVincent commented 4 years ago

Absolutely. Thus far (with the debugging steps removed that didn't work):

  1. npm install -g gatsby-cli
  2. nvm upgrade
  3. nvm update
  4. yarn add gatsby-theme-andy

With variants of installing npm, yarn, and removing node_modules.

YangVincent commented 4 years ago

Just kidding, managed to get it working. I was trying to run this current project, instead of starting my own and adding this as a module.