-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gatsby-source-contentful not downloading images with downloadLocal true #33871
Comments
We also seem to be hitting this. Especially when using Btw. this was something I stumbled upon when last researching this, which seemed relevant: |
@julrich did you try to apply the changes of the PR? |
It's released already according to the I suspect we might be hitting a special case not handled correctly (yet?) |
Yes, I think so as well... |
Probably worth mentioning, we're accessing const image = await context.nodeModel.findOne({
query: { filter: { id: { eq: source.imageId } } },
type: "ContentfulAsset",
});
console.log(image.fields.localFile); // this (more often than not) is undefined That's where we are hitting the missing |
For the record, this produces the same bug:
|
Would also like to report that we had to downgrade back to Gatsby 3 (and the earlier version of |
As with @julrich we also use Contentful Assets local download option via a custom resolver (to enable custom localization fallbacks to English images). In Gatsby Cloud, we get empty localFile nodes 100% of the time. On local develop it mostly/often works and with local builds it often succeeds. After a |
Thank you for the reports, I'll have a look. @wardpeet this could be related to our switch to |
If somebody has public build logs that failed available, that could help! Please link them here. I run into this error while developing the latest versions, a rerun solved it :/ |
I tried your repo, it works fine for me :/ Build it multiple times, cold and warm builds.
|
A question to everybody having this issue: Do you use the |
At least for us we have not set that flag. So I guess we would be using the default value for it. |
Thank you @julrich For everyone running into this issue:This bug seems not to happen on cold builds (after We test this feature in our e2e tests and if they would be flaky/unreliable, I guess we would have seen this in all the PRs Gatsby does on a daily basis. On my side, or my machine, I have trouble reproducing the issue. So any information might help. Could you please give me details in which situations this happens to you and on what platform? |
I found a public run that did run into that issue. It is from a dependency update, this really should not fail here: |
I've tested this fix via |
Preliminary Checks
Description
There seems to be an issue with downloading images from contentful to local if
downloadLocal
istrue
.So this config seems to have bugs:
I tried it twice with two different contentful repositories and two gatsby sites. Sometimes no image is local, sometimes one, sometimes all. I tried different things such as
downloadLocal: false
thentrue
so the images are loaded forgatsby develop
. I also triedgatsby build + serve
but same issues here. The images are always accessible withoutlocalFile
in graphql which means that the images are correctly configured.This is what I get:
I have a minimal reproduction repo at https://github.com/pbizimis/gatsby-contentful-bug. I used a new contentful account so if you need to check something there let me know and I give you the credentials.
(Images are from Unsplash and the config of the repo is not sensitive because the account is a throwaway)
Thanks!
Reproduction Link
https://github.com/pbizimis/gatsby-contentful-bug
Steps to Reproduce
Expected Result
localFile data is available for all images
Actual Result
localFile data is not available for all images
Environment
Config Flags
No response
The text was updated successfully, but these errors were encountered: