[BUG] Previews broke in 12.0.3 + Chrome
See original GitHub issueDescribe the bug I recently noticed previewing (as described in the react-dropzone docs) isn’t working anymore. When selecting an image from the user filesystem, Chrome will show a broken image placeholder instead of the actual image. I was only able to reproduce this in Chromium-based browsers (Chrome/Edge), others (Safari/Firefox) seem to be fine.
To Reproduce Steps to reproduce the behavior:
- Go to https://react-dropzone.js.org/#section-previews
- Click on the dropzone
- Select any image file
- See the broken image placeholder
Expected behavior I expected to see a preview of the to be uploaded image.
Screenshots
Desktop (please complete the following information):
- OS: macOS 12.2.1
- Browser: Chrome
- Version: 98.0.4758.109 (Official Build) (arm64)
Additional context
According to git bisect
the first commit where this issue starts to appear is: https://github.com/react-dropzone/react-dropzone/commit/dbaec3f5ac48c21ad15f71aaaa0ac330a557a2ce
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Print Preview broken in last update - Google Support
After the very last update, there is a bug with printing of html documents from Chrome through the Print Preview window. All documents...
Read more >activated print preview in google chrome but can't see any ...
I enabled it by going to chrome://flags, and restarted chrome. But all I see is a wide grey preview which is not even...
Read more >641318 - Maximize chrome,display only part of the UI - Monorail
Recorded the behavior of this bug. First part shows the bug occurring, second part is a workaround by enabling "Use system title bar...
Read more >The Help Forum: Problem with Safari 12.0.3 - Flickr
My current workaround is to enable the Develop menu in Safari and that then give me the option to Open Page With Chrome...
Read more >How to fix Google Chrome Broken Image Icon error - YouTube
Surfing the internet and you keep getting the Google Chrome Broken Image Icon error ?Here's what you need to do to fix this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Both 12.0.4 and 12.0.2 have the same issue for me. My guess is newer chrome versions are either slower at writing the preview to disk or faster at revoking the ObjectURL(or both).
https://stackoverflow.com/a/63111446
Current workaround
I doubt it’s the best way but my current solution just adds a sleep >=100ms before the revoke so the blob has time to be written to disk. It at least seems to work on localhost that way.
Just noticed this issue 😃
Following PR might fix this, not sure whether it’s the perfect fix but making sure that the blob/data URLs are revoked after image load and component unmount will help avoid urls to get revoked before its consumption
https://github.com/react-dropzone/react-dropzone/pull/1172