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

Set up error - Graphql query fails on new Prismic repo #5

Closed
colbisaurusrex opened this issue Sep 21, 2019 · 23 comments
Closed

Set up error - Graphql query fails on new Prismic repo #5

colbisaurusrex opened this issue Sep 21, 2019 · 23 comments

Comments

@colbisaurusrex
Copy link

Hello,

I followed the read-me step by step and created a Prismic repo, linking it gatsby-config.js where it is required. I get a long list of errors when I start the dev server. Is there something I am missing? Pretty new to Prismic/

Screen Shot 2019-09-21 at 12 27 46 PM

Do you have any advice? I like the starter kit and would love to use it.

Best,

Colby

@timrodz
Copy link

timrodz commented Sep 23, 2019

Ditto. Haven't used Netlify or Prismic before, so I'll try give it a go when I have more time.

@umriyaafini
Copy link

You need to follow all steps in the instruction including a Prismic repository and 3 Custom Types: Project, Post and Project with at least 1 document in each Custom Types.

@colbisaurusrex
Copy link
Author

@umriyaafini Thank you, I have done that and still run into the issue. I created my own Prismic repository, created those custom types and linked it.

@ptrkvsky
Copy link

ptrkvsky commented Oct 5, 2019

Hi, same here, 3 custom types, with copy paste of the JSON, and put my repo name in the gatsby config

EDIT : Running Gatsby clean to clear cache worked for me.

@umriyaafini
Copy link

Have you created the document/content for each type?

I think the error caused by empty allProjects

@delacernamarimar
Copy link

I already copy-paste the custom types and created some data with it, but the issue is the main page it has an error, but if I browse to http://localhost:8000/blog and http://localhost:8000/work my samples the I created are shown,

Screen Shot 2019-10-07 at 7 26 39 PM

@delacernamarimar
Copy link

I already make it work by inputting data in prismic and rerun the app after publishing

I hope it works on your end.

@colbisaurusrex
Copy link
Author

@delacernamarimar Did you create your own prismic repo?

@colbisaurusrex
Copy link
Author

@barbgegrasse nice, I will give it a shot

@colbisaurusrex
Copy link
Author

@umriyaafini I haven't created any new content - all custom types have a schema, but I haven't created any actual posts, etc

@delacernamarimar
Copy link

@colbisaurusrex yes I created it, create some post so that you can test,

@h13o
Copy link

h13o commented Oct 24, 2019

Please try @barbgegrasse's advice. It solved my prob. Thank you!

gatsby clean

@adamUpchurch
Copy link

gatsby clean
Worked for me too!

@chaserx
Copy link

chaserx commented Nov 5, 2019

I found some luck with this issue changing the repository security to Open API. Unsure if there's a way to add API credentials.

Screen Shot 2019-11-04 at 9 22 51 PM

update: add accessToken: '...', to the options https://www.gatsbyjs.org/packages/gatsby-source-prismic-graphql/

@georgex1999
Copy link

I had a bit of trouble setting this up but it's pretty cool now it's running! Thought I would add some things it took me a while to grasp:

  • If you, like me, are new to prismic.io.. you can't just setup the Custom types as stated in the readme you also need to add Content to them and Publish. This may seem obvious but stumped me for a while!
  • As far as I could tell you need to fill in ALL the fields with content to get the site up and running. Otherwise you get a NULL value error.
  • I had an error that stumped me for a while and it was because I hadn't added the link properly to the social media link. I'll attach a screenshot of this in case it catches anyone else out and the error it brings up.

Screenshot 2020-01-24 at 21 32 59

Screenshot 2020-01-24 at 21 42 04

@jtcarrasco
Copy link

having the same issue as everyone has there been any recent updates?

@croensch
Copy link

croensch commented Mar 21, 2020

First, thank you that is an amazing template.
I found out yes, you have to create content for "Post" and "Project" but also "Homepage". For the last one i filled everything but i still get TypeError: social.about_link[0].spans[0] is undefined anyone can help? nvm @georgex1999 thx

@databyjp
Copy link

Yup I also had the same issue - resolved by running
gatsby clean

@JesseSingleton
Copy link

@georgex1999 That was super helpful as someone who hadn't used Prismic.

@margueriteroth Really appreciate the template. Can I suggest that someone adds @georgex1999
tips as a Tips/Errors section or as steps in the readme. I can look at doing that if you like!

@k-hud
Copy link

k-hud commented Jul 2, 2020

@margueriteroth thanks so much for this template. Setup was super clear and easy to do. Much appreciated.

Agree with the above, I'd recommend adding a few more points to the end of "3. Define your Custom Types" telling the user to fill out at least enough content in the Custom Types to populate one of each type, and definitely show adding the URL to the About section. Adding enough content to everything else doesn't do it, you have to add the URL type within About for the project to work.

Thanks again.

@marguerrrite
Copy link
Owner

Thank you @kylemhudson, @georgex1999, @JesseSingleton, and everyone else for outlining this issue and solution. I've added a Tips & Common Errors section to the readme and included these items.

@k-hud
Copy link

k-hud commented Jul 6, 2020

@margueriteroth amazing, thank you!

@br34th3r
Copy link

It was gatsby clean for me as well, thanks everyone!

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

No branches or pull requests