-
Notifications
You must be signed in to change notification settings - Fork 803
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
Carousel: error thrown in originalDimensions
function
#11191
Comments
@jeherve No other plugins installed. The post I was testing this on had a tiled gallery on it as well, but that's it. You can see it here: https://unaware-water-10.jurassic.ninja/2019/01/24/testing-carousel/ |
And boom, site is gone. Did you manage to test it out before it went dark, @jeherve ? That's why I didn't add a link on it on the original issue. |
oh sorry, I was looking at another issue! :( Can you reproduce with a brand new site now? |
No worries, @jeherve — will try to reproduce and report back. |
@jeherve Yep, managed to reproduce here: https://marxist-caribou.jurassic.ninja/2019/01/24/testing-galleries/ It seems that this error is only triggered when a simple gallery is used in tandem with a tiled gallery block. As you can see it doesn't happen with just the gallery block: https://marxist-caribou.jurassic.ninja/2019/01/24/testing-carousel-with-simple-gallery/ |
So I've been looking into this as it's been causing issues (see jetpack/modules/carousel/jetpack-carousel.js Line 1205 in 6189a00
This is causing a JS error to be thrown which causes the UI to freeze up. This attribute appears to be added here ...which if you trace it back gets its data from a call to However, if the image is not stored on the site there is no attachment. How can this happen? If you take a set of blocks and paste them into the editor (or insert them via code) then it's perfectly possible to have a gallery referencing images from another site. You should also read So
|
Got the same problem here. Externally hosted images, the only one working in the carousel is the wider image at the bottom. Others don't show up and show the same Javascript error mentioned above. |
Another report in #16986623-hc possibly related to externally hosted images. |
User in 2792313-zen gets this same error but does not seem to have externally hosted images. |
Another report in #3244831-zen |
I noticed the same issue on https://docs.woocommerce.com/document/woocommerce-blocks/#section-2 where you can click any of the images in the gallery. The only way I was able to reproduce it at this point in time is by adding a Gallery Block with one image, switching to Code Editor, and removing this set of 4 attributes for the
So possibly this has been somehow addressed in the latest versions of Gutenberg (which updated the Gallery Block)? I noticed that the issue is present when Gallery Block has no
For Gallery Blocks added in the past,
I hope these bits help in any way. |
Encountered another case of this on a WP.com site in #24528170-hc / #3364177-zen Recreated on this test page by copying the code over. Is there a workaround to get it working now, or any way to avoid this? |
Also reported in 23458609-hc The workaround we used was to disable Carousel in |
An additional note on this one ^ The carousel was deactivated pending this bugfix, but when it's activated, it works fine if you're logged in to the site, but not if you're logged out. |
A customer reported this issue this week and I was able to reproduce it here: https://melissasgutenbergteststuff.blog/gallery-variations/ The very first gallery image with the caption "lone gallery image" I see this issue was reported in January 2019 almost 2 years ago, do we have any fix coming or a workaround? I notice this does not happen with the Tiled Gallery block. |
Another report in 25432752-hc |
Another report in 3740078-zd-woothemes |
If it helps any, we have permission from that user to make minor changes to their site at any point while figuring things out. If you'd like me to go in and see if editing and fixing will work at a later point, or ask the user to do so, we can make that happen. Thank you for your hard work! |
The carousel currently fails if some crucial data properties are missing in the images it attempts to load. This will make it more robust, allowing it to fall back to other ones. In addition, it restores the pointer cursor in some situations. Fixes #11191. Co-authored-by: Brandon Kraft <public@brandonkraft.com>
Thank you, @goblinartificer! This should now be fixed on wpcom! 🙂 It looks like the test site I was using was changed to the Gutenberg slideshow, however, so I can't directly test. |
@sgomes I checked my old test page for this: https://melissasgutenbergteststuff.blog/gallery-variations/#jp-carousel-63 I no longer see the same errors in console, but the issue persists Should this be a new issue if the errors are different? Seems like the exact same problem visually, and I spot-checked a few reports above and found this unfixed, including:
|
@msilbers I forgot to post here, but it's still persistent even on the case I reported earlier — same Slack thread as above, but later comment: p1624337699095100-slack-C03TY6J1A |
Thank you, @msilbers! It looks like the images in your gallery are yet another variation in how data can go missing. I'll try to account for those as well 👍 |
The issue appears to be that there are situations where images contain absolutely no width and height information in the markup. This makes it impossible for us to display them in the current setup. @jeherve : what do you think we should do here? The only solution I see is to preload all of the images that don't have sizing info, so that we can know their size ahead of opening the carousel. Do you think that's acceptable? |
Would it be acceptable / possible to not trigger any Carousel modal for such images? If width and height is missing, I assume there was a problem during upload. This may happen on posts with lots of big images, maybe, in which case we wouldn't want to start pre-loading images on such posts since that would potentially be a lot of images. |
The issue is that some versions of Gutenberg generated galleries without sizing info, which is what happened here. The upload worked well and the images exist in a good state, but the gallery is simply missing the info because it wasn't part of the markup that Gutenberg produced. That's since been fixed, but the new markup doesn't get applied unless the user updates Gutenberg and then goes in to edit their post and (presumably) click the buttons to fix the mismatches in markup. I think we have one last option that doesn't involve preloading, which is to use the thumbnail natural size; we already measure that, so we can just display the tiny gallery image in the carousel, as we're already doing in other cases. I'll give that a try. |
Using the thumbnail natural size appears to work. Created #20149 with the fix. |
Both the test cases from @msilbers and @goblinartificer appear to be working well with the latest fix! 🙂 (live in wpcom; scheduled for Jetpack 9.9) As such, I'm closing this issue again, but please do reopen it if you find any other examples! We'll get rid of all of those edge cases yet! 😄 |
The problem seems to happen on this site, whether they run Jetpack 9.8.1 or Jetpack 9.9: I am not sure why this happens there, though I do note that they use WP Rocket and its defer JS feature. That said, the reporter mentioned that excluding the Carousel's script from being defered does not appear to solve the issue. |
@jeherve : thanks for the link! It looks like that's a separate issue. The carousel doesn't behave too well when there are exactly two slides, apparently. I'll look into it. |
Update: I'm not able to test things with this exact site, but I implemented a 2-slide carousel (using the carousel in |
It would appear that it didn't on that specific site; the owner experiences the same issue when updating to 9.9. I cannot reproduce the problem on my end, though. :\ @fernandotellado Would you be able to copy the HTML you have in the editor for that post, and send it to us, either in a Gist or privately via our contact form? Thank you! |
Of course, here it is: https://github.com/fernandotellado/fernandotellado/blob/master/jetpack-9-9-issue |
Thank you! Any chance you could copy from the HTML view in the editor as well, like so? Screen.Recording.2021-07-07.at.17.22.10.mov |
Ah, of course, here it is: https://github.com/fernandotellado/fernandotellado/blob/master/html-post-slider I can even give you admin access to the site if you want to make the test by yourself ;) |
Hi Team, I see the issue is still occurring on this site When a picture is selected I get a black screen and the page becomes unresponsive. |
Thank you, @kerrynicl ! This is the most extreme case of missing info I've seen so far 😕 In this case, the attachment ID property is present but empty, so there isn't anything meaningful we can do with the image. The only reasonable course of action in these situations is probably to simply refuse opening the carousel. @jeherve, what do you think? |
@sgomes Jeremy is AFK for a bit, but I did some extensive testing and definitely seems something is up with the images. Trying to do some testing and they are being saved as webp images? I'm not sure what's up with that. @kerrynicl I think I would have them try and re-upload the images, or download them and re-upload them and see if that fixes things. Are they able to use the carousel with other images/galleries, or does it happen for all of them? Or, like Sergio suggested, try disabling the carousel. |
@Thelmachido I'm afraid you're running into a different problem entirely. This issue is for the Carousel feature, triggered when opening gallery images. You seem to be having issues with the Post Carousel block, a block that's developed and maintained in this repo. I would recommend opening an issue there directly. Note: When you create that new issue, I would encourage you to upload your screenshots and screencasts to GitHub directly instead of using Droplr. See this for more info: |
Thanks posted on the correct repo, I will remove the above comment, to avoid confusion. |
Got a chat in 35760928-hc where Images in Carousel are black when you click on images in Gallery block. I see this when I inspect: However, I took a look at the image URL and it looks to be an import file URL. The user mentioned they just imported from Wix so in this case, the issue seems to be because it is an import file so uploading the file directly should fix it but commenting here just in case it is related to this issue. |
Steps to reproduce the issue
What I expected
What happened instead
Which seems to originate from the
originalDimensions
function:jetpack/modules/carousel/jetpack-carousel.js
Line 1067 in 6189a00
Screenshots
The text was updated successfully, but these errors were encountered: