Open honzik opened 4 years ago
I'm running into the same issue receiving the same error message on a recent project. Whenever an imageSharp
property is present in the query the error appears in preview mode.
What is interesting is that the same setup (using the same dependency versions) works fine with another Prismic repository I created a few months ago. Could it be that the way images are served for preview is a bit different on more recent Prismic repositories and this causes the error?
I'm having the same issue which can be seen here - https://prismic.link/38EUXwj Im using imageSharp and following the same way in which its use is described here - https://github.com/birkir/gatsby-source-prismic-graphql#working-with-gatsby-image
Falling back to the normal image if image if sharpImage
is not present
Is there any updates with this issue?
It seems that the documentation that describes falling back to a normal image is no longer correct.
If you include sharpImage in your query, the entire preview query fails and reverts to show content from master (due to the above error).
For now I have no choice but to remove imageSharp from my query all together.
Same issue here as above comment.
I was able to resolve by setting fetch-policy: 'no-cache'
As stated here: https://github.com/Digitaliseringsbyran/gatsby-source-prismic-graphql/commit/a0e2556d140a4d4bd9ac0329a7a341f72818d3b0
I tested this on 3.6.3-alpha.12
, but is also failing when using the fallback image, the query keeps failing when calling a sharp image, any workarounds on this?
I am also getting this issue, preview works fine when not using imageSharp in a query. If I apply the fix suggested by @alexanderfountain to the latest release (3.6.2) this does indeed fix the issue.
I'm having the same issue with the latest version
Cannot read property 'directives' of undefined
Description
When I add
imageSharp
version ofimage
field of my image from Prismic and try to obtain in usingfluid
orfixed
optimization, preview fails with a weird error. When I remove theimageSharp
property from GraphQL query, it works well and preview is displayed correctly with live data from Prismic.Without preview, when I test published sectors only, all works just fine.
I know preview is not supposed to use Gatsby image optimizations. But in Readme you state that the query will go through, and I only need to test if
imageSharp
isnull
.Site config
gatsby-config
part:sector.js
template query that fails:Component code is not relevant here, this error depends solely on including or removing the
imageSharp
property from GraphQL query.This is the error I am getting in console:
And my
package.json