-
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
fix(gatsby-plugin-image): do not show placeholder if image already lo… #28868
Conversation
I'm running |
Thanks for noting @laurenskling. Do you have a code reproduction? I have to confirm this is in the latest next but I believe it should be, so want to take a closer look. |
Well, it's kind of hard to isolate this piece of code from my codebase. this PR is mentioned in the release notes: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-image/CHANGELOG.md#060-next1-2021-01-12 in my yarn.lock:
|
So I dug a little deeper, it's actually from So I guess #28407 is actually not working for me? |
Just as a test, can you try removing the carat from your version in package.json for gatsby-plugin-image and re-install deps? That version isn't what I expect to see "0.6.0-next.1" is. It may still be an edge case you're hitting, but I want to be sure. |
Wow I didn't even catch it myself! I'm glad I pasted the lock entry, don't even know why I did! So i actually got new lock:
|
Awesome. If you can, I'd recommend using the codemod to help you refactor. You can even run it on individual files if you like. https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-image#upgrading-from-the-gatsby-image2 |
Okay, I'm running |
So just to clarify, if you go back to the same route the blur up is introduced once? Or it continues to blur up for that page no matter what? |
I made a branch release: https://feature-image-next--ev-auto.netlify.app/ (be aware that the "header images" of the cars in a showroom are So a couple of things are off:
|
Ya, seeing the thing with ocassions and the logo. Will dig into it. Thanks for the reproduction! I'll let you know if I get anywhere but it may be challenging without source code. |
I'm actually getting the same behaviour as noted above on There isn't much special about my code. some snippets: a static query containing:
and rendering
|
Hey @laurenskling, sorry for the delay. There is a PR in now for a race condition in the images code and I'd love to wait and see if that affects this bug. I'll let you know when it's in next so you can test it out. |
Yeah sure, drop a comment when it's in; i'll do a new release with that version and we can compare |
Hey @laurenskling, it should be available in next. |
Sadly the mentioned behaviour is still present in the latest next (0.7.0-next.1) |
Thanks for the patience @laurenskling! Fix is forthcoming in #29333 |
Thanks @laurieontech |
@laurieontech any ideas about the blink effect? Should I make a seperate issue for it. The placeholder image gets removed, which makes the opacity transition not working anymore. It will show placeholder -> nothing -> fadein. Its pretty nasty jumping. Example: https://feature-image-1-1-0-next-1--artzautos.netlify.app/voorraad (still present in current version) |
@laurenskling can you disable gatsby-plugin-offline and see if you still have that issue? |
i've installed |
@laurenskling Ok I found the bug it's the if case here: gatsby/packages/gatsby-plugin-image/src/components/lazy-hydrate.tsx Lines 73 to 84 in 65f3005
Could you make a new bug? This can be fixed by using React.memo or make sure we show the placeholder each time. |
Description
Move development fix to lazy-hydrate to make sure hydrated.current is not always true to support image caching between routes.
Documentation
Related Issues