Set up instructions are not working for me
matine opened this issue · 5 comments
Hello,
Thanks for this great starter portfolio! It looks really great apart from the fact I'm having some trouble setting it up using your instructions.
I've followed your guide and have set up a prismic repo, added content, the API key etc. It does compile so that says to me that it is accessing the prismic repo. But it doesn't seem to retrieve the data in the index page.
I get lots of errors in the console but the first important one being...
The prop `data` is marked as required in `IndexPage`, but its value is `undefined`
And in the command line when compiling I get...
ℹ 「wdm」:
ℹ 「wdm」: Compiled successfully.
WAIT Compiling... 3:13:51 PM
ℹ 「wdm」: Compiling...
GraphQL Error Unknown field `prismicCaseStudy` on type `Query`
file: /Users/matinechabrier/Sites/gatsby-starter-portfolio-bella/src/templates/case.jsx
1 |
2 | query CaseBySlug($uid: String!) {
> 3 | prismicCaseStudy(uid: { eq: $uid }) {
| ^
4 | uid
5 | first_publication_date
6 | last_publication_date
7 | data {
8 | header_image {
9 | localFile {
10 | childImageSharp {
11 | sizes(maxWidth: 1920, quality: 90, traceSVG: { color: "#021212" }) {
12 | ...GatsbyImageSharpSizes_withWebp_tracedSVG
13 | }
I'm wondering do I need more in my env file? I only have that API key in there. Otherwise I'm really not sure what it could be as it looks correct to me.
Did you set up the custom type with the JSON I provide and created at least one document with this custom type? The PropTypes warning says that it didn't get any data back from the query.
Please try another image as sharp
can't process .gif
files. I think we can narrow it down to Prismic as I just successfully used this starter locally with my Prismic repository.
Does the query for in GraphiQL? (So localhost:8000/___graphql
)
Yes that worked!! It was because it was a gif.
Thanks so much :)
I think I'll add that to the README. Glad that you got it working. Have fun 👍