Error initialising the index page
See original GitHub issueThank you so much for making the prismic starter. I was trying to develop the site on my own for the first time. I have already setup:
- Prismic Account with API Token
- Created all types of content on Prismic.io
- Successfully to retrieve data via localhost:8000/___graphql
I have successfully completed gatsby-develop
command, but it appears empty in the browser. Console indicated the following errors.
Failed prop type: The prop `data` is marked as required in `Index`, but its value is `undefined`.
Uncaught TypeError: Cannot read property 'homepage' of undefined
Uncaught TypeError: Cannot read property 'homepage' of undefined
Is there anything that is missing? I have created a repo to re-create the issue. For your conveninence, i have also added the token in the config file. https://github.com/sparklesam/dojo_20181019
Thanks a lot!
System: OS: macOS High Sierra 10.13.6 CPU: x64 Intel® Core™ i5-7267U CPU @ 3.10GHz Shell: 3.2.57 - /bin/bash Binaries: Node: 10.8.0 - /usr/local/bin/node npm: 6.2.0 - /usr/local/bin/npm Browsers: Chrome: 69.0.3497.100 Firefox: 63.0 Safari: 12.0 npmPackages: gatsby: ^2.0.24 => 2.0.27 gatsby-image: ^2.0.15 => 2.0.15 gatsby-plugin-emotion: ^2.0.5 => 2.0.5 gatsby-plugin-lodash: ^3.0.1 => 3.0.1 gatsby-plugin-manifest: ^2.0.5 => 2.0.5 gatsby-plugin-netlify: ^2.0.1 => 2.0.1 gatsby-plugin-offline: ^2.0.6 => 2.0.7 gatsby-plugin-react-helmet: ^3.0.0 => 3.0.0 gatsby-plugin-sharp: ^2.0.7 => 2.0.7 gatsby-plugin-sitemap: ^2.0.1 => 2.0.1 gatsby-plugin-typography: ^2.2.0 => 2.2.0 gatsby-source-prismic: ^2.0.0 => 2.0.0 gatsby-transformer-sharp: ^2.1.4 => 2.1.4 npmGlobalPackages: gatsby-cli: 1.1.58
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Yes it works! Thanks so much for your help!
Ok, I know what’s causing this issue: Your test post only contains a “text” slice but it has to have also all the other slices. Otherwise Gatsby won’t build the schema. I’ll add a note about that in the instructions (that you have to use every slice at least one time)