Invalid prop query
of type object
supplied to StaticQuery
, expected string
.
#70
Comments
Same issue here. I think it's related to those lines. Is there a reason that "query" can't be an object ? @braican @birkir gatsby-source-prismic-graphql/packages/gatsby-source-prismic-graphql/src/gatsby-browser.tsx Lines 6 to 15 in 6f51996
|
Upgraded to Am now getting the same error as above. Runs ok with error with The basic StaticQuery example here is not working https://www.gatsbyjs.org/docs/static-query/#basic-example Thanks in advance |
Fixed my issue with updating to 3.4.0-beta.1
|
Ok, i have the Solution now for the broken template after updating to 3.4.0-beta.1. You need to replace every component with {RichText.render(document.data.title, linkResolver)}. Now my development and build command just works fine. |
Which I believe is coming from
Here is a basic repo that reproduces it https://github.com/matthewlein/prismic-gatsby-errors My changes were:
which you can see all here: matthewlein/prismic-gatsby-errors@5ad2ef9 |
Looks to only break the |
the main example above that i got this and still get this with is as you say |
Alrighty, it's somewhat related, but maybe not. I created a new issue for the hook #77 |
@matthewlein thanks for the repo, I've forked it and managed to fix the errors when running The errors where coming from src/template/products.js. First error Second error when running gatsby build. <h1>Product: {doc.node.product.name}</h1> <h1>Product: {doc.node.product_name[0].text}</h1> or better yet {doc.node.product_name.map(({ text }) => (<h1>Product: {text}</h1>))} I'll create a PR so you can see the changes. |
@MarcMcIntosh Thanks for looking at that, I have a new ticket for the hook #77 that i'll comment on, its unrelated to this issue. |
@chrishawn if you can give me a repo in which the issue is recreated i'll take a look :) |
Is there a fix for this issue? still getting: |
@YordanLV You're probably seeing the |
try to set query as a stact property on your component.
|
@MarcMcIntosh not much use if you're using functional components |
@seaneking |
Derp, sorry stupid mistake on my part. What I get for commenting pre-coffee 😅 |
@MarcMcIntosh I don't see how this solves the problem at all if you do what you suggest in the example above you just get |
to stress, the |
@chrishawn it's a solution to an error I've seen a lot of. |
As a workaround, you can toString the object. E.g.
EDIT: This solves on problem, but now its throwing a warning in the logs. So, maybe dont do this. |
Using this following solves the problem.
|
when i have code like
i keep getting a warning now of
it seems to run fine, any thoughts on how to fix this warning?
moving the query directly into the StaticQuery produced the same results
my package versions are
The text was updated successfully, but these errors were encountered: