Closed kevindstevens1010 closed 4 years ago
Note: I updated the BrainNote.Js file and am now getting this error which is why I ask:
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:
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: /Users/www/my-gatsby-garden/node_modules/@aengusm/gatsby-theme-brain/src/templates/brain.js
Hey!
I try to publish a new package to npm with a new version whenever something gets updated or fixed in the package. So, a yarn install
or npm install
should get you the new version. Sometimes deleting the node_modules
directory and installing gets latest versions.
Regarding that error, can you check which version of Node you are using? We would need at least v12 to run this.
Still not working after deleting node modules and bringing them back in.
I'm running Node v.14.5.0
Note: I updated the BrainNote.Js file and am now getting this error which is why I ask ...
Where does this file exist in your repo? And is it possible to share the code somehow?
Of course, here's the path:
/my-gatsby-garden/node_modules/@aengusm/gatsby-theme-brain/src/components/BrainNote.js
And here's the code in BrainNote.js
We don't ideally touch/change things in the node_modules
folder. What is the result you are aiming for?
We can use component shadowing to update the components as we like. More about that here. Basically we place a file at the respective path in our project, and this file overwrites the original file in node_modules
. For example, if you want to change node_modules/gatsby-theme-andy/src/components/BrainNote.js
, we create a file at src/gatsby-theme-andy/components/BrainNote.js
.
What's the best way to update the theme as you work on updates?