Comments (19)
@elkorn could you please reopen the issue? I tried with both:
- following write-up from https://prismic.io/docs/reactjs/getting-started/prismic-gatsby
- cloning the "arnaud" example https://github.com/birkir/gatsby-source-prismic-graphql/tree/master/examples/arnaud
and I am also seeing an empty edges
array. The query runs fine in GraphiQL (with query variables) but as you mentioned in #47 (comment), the uid
property is empty in pageContext
.
I can also confirm than the last version the query runs properly is 2.8.8
(from @brandonfancher #32 (comment)). After that, the edges
array is empty.
from gatsby-source-prismic-graphql.
Upgrading gatsby-source-prismic-graphql to 3.4.0-beta.2 did fix the problem for me.
from gatsby-source-prismic-graphql.
Good question.
Only thing I can think of is a case where its just the preview page.
Also, you can check with the lang
paramter
from gatsby-source-prismic-graphql.
heisenbug. Started working for no apparent reason. I deleted the cache multiple times so I don't think it was that which helped. As far as I was able to see from digging in - the plugin was actually passing the uid
correctly into createPage
, but it didn't come out to pageContext
in WrapPage
.
Closing for now, I'll reopen if I have any new information.
from gatsby-source-prismic-graphql.
I'm having the same issue, queries return empty results as if uid is not being passed in, even though I've verified it is being set in gatsby-node.js from this plugin.
My page component:
import { graphql } from "gatsby"
import * as React from "react"
import Layout from "../components/layout"
export const query = graphql`
query Page($uid: String!) {
prismic {
page(uid: $uid, lang: "en-us") {
title
body
}
}
}
`
const Page = ({ data }) => {
console.log(data)
return (
<Layout>
<h1>Test page....</h1>
</Layout>
)
}
Page.query = query
export default Page
and my gatsby-config.js contains:
{
resolve: 'gatsby-source-prismic-graphql',
options: {
repositoryName: `puppet`, // (required)
accessToken: `12345`, // (optional)
path: `/preview`, // (optional, default: /preview)
previews: true, // (optional, default: false)
pages: [{ // (optional)
type: `Page`, // TypeName from prismic
match: `/page/:uid`, // Pages will be generated under this pattern (optional)
path: `/page`, // Placeholder page for unpublished documents
component: require.resolve('./src/content-types/page.js'),
lang: `en-us`
}],
}
},
But all I get back in my component is:
{
data: {
prismic: {
page: null
}
}
}
The query works fine in GraphiQL so I don't think there's any problem with that, just not returning any data from the PageQuery for some reason.
I've tried this with previews enabled and disabled and had the same problem either way.
from gatsby-source-prismic-graphql.
I'm also running into the same issue @elkorn and @mikeyp, and it looks like rolling Gatsby back to 2.3.17 fixes the issue for now.
See here: #32 (comment)
from gatsby-source-prismic-graphql.
Also running into this issue, however, Gatsby 2.3.17 did not fix the issue for me. @mikeyp any luck in the end?
from gatsby-source-prismic-graphql.
Having the same problem. When running gatsby develop
, the uid
does not get passed to the GraphQL query. If doing gatsby build
however, everything does work.
EDIT: now seems to work using gatsby 2.13.51 and gatsby-source-prismic-graphql 3.3.1.
from gatsby-source-prismic-graphql.
Reopening the issue for @mlbrgl.
from gatsby-source-prismic-graphql.
I am having this issue as well. Has anyone come up with a temporary workaround?
from gatsby-source-prismic-graphql.
Having the same issue here UID is not being passed to the page templates
from gatsby-source-prismic-graphql.
same issue, and fixed by upgrading to the 3.4.0-beta.2 (thanks @ascii-husky!)
from gatsby-source-prismic-graphql.
Thanks for the tip @ascii-husky, upgrading made it work for me as well.
from gatsby-source-prismic-graphql.
Hello everyone,
Got the same issue with :
"gatsby": "^2.17.6",
"gatsby-source-prismic-graphql": "^3.3.1",
updated to below and worked :
"gatsby": "^2.17.10",
"gatsby-source-prismic-graphql": "^3.3.1", (no changes)
from gatsby-source-prismic-graphql.
Had the same exact issue as vincent-wantomo, and updating to gatsby 2.17.10 did the trick for me also, in case anyone doesn't want their source plugin to be on a beta version
from gatsby-source-prismic-graphql.
Thank god, was going insane thinking I did something wrong. Can confirm that upgrading Gatsby passes uid correctly now.
from gatsby-source-prismic-graphql.
Looks like it's not working with useStaticQuery
though.
from gatsby-source-prismic-graphql.
from gatsby-source-prismic-graphql.
Lost a couple of hours on the same issue, upgrading gatsby from 2.17.4
to 2.19.17
solved it. Thank you 👍
from gatsby-source-prismic-graphql.
Related Issues (20)
- Pagination broken - prismic.load throws error HOT 1
- Cannot find module './third-party/gatsby-node' HOT 76
- Preview path incorrectly created during Gatsby build process HOT 1
- Can't get previews working HOT 5
- [bug] Node crashing when using onCreatePage HOT 1
- imageSharp returning null HOT 6
- [Solution] Prevent preview script from being downloaded if not needed
- [Feature request]: Add meta tags to be used in pages filter method HOT 1
- [Discussion]: Enable More Maintainers of the Project HOT 12
- StaticQuery is not working HOT 4
- Build failures for large images
- [BUG] Can't get more than 20 results HOT 1
- UPDATE: Statement from Prismic HOT 6
- New fields added to repeatable type not showing in project HOT 1
- Can't load more than 20 items HOT 7
- Is there a way of Generating/Using a custom index page?
- [Feature request] Add plugin option for prismic.io address
- Apollo Client in production build
- The Prismic API started including "y" HOT 1
- __typename does not match generated type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-source-prismic-graphql.