Closed steoneill closed 4 years ago
Yes, my understanding of this issue is that sharp/gatsby-image require the image to be on disk to do transformations. While images in prismic are handled through imgix, it should be able to pass those parameters to imgix but then sharp wouldn't be doing the transformations.
I think there was a similar issue with contentful. https://www.gatsbyjs.org/packages/gatsby-transformer-sharp/#how-to-use
Note: An exception to this is when using gatsby-source-contentful, as the source plugin and the assets are not downloaded to the local filesystem. By default, the gatsby-source-contentful plugin creates a ContentfulAsset node for every image with links to Contentful’s CDN, therefore it is not necessary to use gatsby-transformer-sharp together with gatsby-source-contentful.
I was able to tweak the fix from here.
gatsby-node.js
var fs = require("fs")
var dir = "./.cache/caches/@prismicio/gatsby-source-prismic-graphql"
exports.onPreBootstrap = () => {
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true })
}
}
@TimFletcher interesting :) does it download the file?
@steoneill should be fixed now :)
When querying an imageSharp field, i get this back: