prismicio-community / gatsby-starter-prismic-blog Goto Github PK
View Code? Open in Web Editor NEWBlog project with Gatsby & Prismic
Home Page: https://gatsby-starter-prismic-blog.vercel.app
License: Apache License 2.0
Blog project with Gatsby & Prismic
Home Page: https://gatsby-starter-prismic-blog.vercel.app
License: Apache License 2.0
Followed your tutorial below, but getting an error in the browser.
https://user-guides.prismic.io/en/articles/2933292-sample-blog-with-api-based-cms-gatsby-js
TypeError: t is null
Any ideas?
I was following this guide and managed to get things running (after some other odd errors):
https://intercom.help/prismicio/en/articles/2933292-sample-blog-with-api-based-cms-gatsby-js
However, when navigating to a blog post after running gatsby develop
, it simply shows a blank page. In the Prismic repository, all fields are filled in as expected.
Logging props.data.prismic.allPosts.edges
in post.js
reveals an empty array. No matter what post is navigated to, it's simply blank.
I feel like there's an issue with the setup/query that fetches the post. It's almost as if the UID is not getting passed correctly?
If I try the query in the GraphiQL playground with the post UID it works but in the template, the exact same query does not return the post.
query BlogPostQuery($uid: String!) {
prismic {
allPosts(uid: $uid) {
edges {
node {
_meta {
id
uid
type
}
title
date
body {
__typename
... on PRISMIC_PostBodyText {
type
label
primary {
text
}
}
... on PRISMIC_PostBodyQuote {
type
label
primary {
quote
}
}
... on PRISMIC_PostBodyImage_with_caption {
type
label
primary {
image
caption
}
}
}
}
}
}
}
}
Any ideas what's going on here? On the home page, the post is listed just fine (so of course it does exist).
There are no errors in the web console nor the terminal.
Thanks.
When querying for the 'sharp' version of an image field gatsby build will fail unless gatsby develop is ran first. This results in not being able to deploy.
I have replicated this issue with a fresh pull of this repo and only making this change to the query on the post.js template to ensure that it wasn't any of my other template changes:
... on PRISMIC_PostBodyImage_with_caption{
type
label
primary{
image
imageSharp {
absolutePath
childImageSharp {
fluid(maxWidth: 800) {
...GatsbyImageSharpFluid
}
}
}
caption
}
}
Resulting in this error:
When trying to debug the changes I have noticed that there are no cached files created for gatsby-source-prismic-graphql on gatsby build. I removed .cache from .gitignore in order to be able to track the cache files created.
If I remove .cache from .gitignore and I follow the process of:
If I was to repeat this process again and remove the created redux files from the cache directory after step 2 before running gatsby build again then the same initial error is given again so I think this is the route of the issue.
After looking in the code as much as I can I can't seem to find what is creating the redux files in the cache directory but I am not an expert at this.
If there is anything I can do to help with this issue please let me know as I am stuck but hit the wall in terms of what my expertise at this will help me debug. Thanks!
(Update - I have created a repo with the example build and the progressive cache commits incase this helps https://github.com/MatthewShields/issue--prismic-blog-gatsby-build)
Preview page remains stuck at loading screen when the prisimic repository isn private. I opened dev tools and discovered that there is a 401 error logged ton the console.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.