Skip to content
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

[Block] File: Embedded PDF fails to render #55493

Closed
cuemarie opened this issue Oct 19, 2023 · 7 comments · Fixed by #55667
Closed

[Block] File: Embedded PDF fails to render #55493

cuemarie opened this issue Oct 19, 2023 · 7 comments · Fixed by #55667
Assignees
Labels
[Block] File Affects the File Block Browser Issues Issues or PRs that are related to browser specific problems [Type] Bug An existing feature does not function as intended

Comments

@cuemarie
Copy link

Description

Embedded PDF files fail to render in Safari Version 17.0 when using Gutenberg 16.7.0 and higher. GB 16.6.0 works as expected.

Step-by-step reproduction instructions

  1. Site with Gutenberg 16.7.0+ active
  2. Add the File Block to a page or post and embed a PDF
  3. Enable "Show Inline Embed"
  4. Publish the page
  5. View the page in a Safari browser

Screenshots, screen recording, code snippet

Comparing GB 16.6.0 and GB 16.8.1 in Firefox (left) and Safari (right)

Screen.Capture.on.2023-10-19.at.11-32-40.mp4

GB 16.6.0

Markup on 2023-10-19 at 11:26:36

GB 16.7.0 and up

Markup on 2023-10-19 at 11:27:52

Safari failure to reload

I also find if I leave the page long enough, the page fails to reload, and I have trouble viewing anything in the browser console:

screenshot

Environment info

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@jordesign jordesign added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. [Block] File Affects the File Block labels Oct 19, 2023
@apeatling
Copy link
Contributor

Confirmed this to be an issue in trunk with Safari latest. I noticed that the first render of the PDF in the editor works correctly, but if you toggle the inline embed setting it breaks. It did not work in the front end.

Screenshot 2023-10-25 at 11 03 32 AM

@apeatling apeatling removed the Needs Testing Needs further testing to be confirmed. label Oct 25, 2023
@ironprogrammer
Copy link
Contributor

Test Report

I am able to reproduce this issue. Removing Needs Testing. Upgrading from GB 16.6.0 to 16.7.0+ presents this issue.

Also noteworthy: With GB deactivated, WP 6.4-beta/RC and wordpress-develop:trunk also exhibit this issue. Upgrading from WP <= 6.3 to WP 6.4-beta/RC presents this issue on existing posts with File block.

Environment

  • Hardware: MacBook Pro Apple M1 Pro
  • OS: macOS 13.6
  • Browser: Safari 17.0, Google Chrome 118.0.5993.88, Mozilla Firefox 118.0.2
  • Server: nginx/1.25.2
  • PHP: 8.2.11
  • WordPress: 6.5-alpha-56966-src, 6.3.1
  • Theme: twentytwentythree v1.2, twentytwentyfour v1.0
  • Active Plugins:
    • gutenberg v16.9.0-rc.1, v16.6.0, v16.7.0, v16.8.1

Actual Results

  • ✅ PDF is not displayed correctly on frontend with GB 16.7.0+ or trunk. Observed the following permutations of this issue:
    • Page loads with gray box in place of the PDF.
    • Page displays with blank area in place of PDF, and eventually times out with error from issue description.
    • Page does not display anything, and eventually times out with error.

@hellofromtonya hellofromtonya moved this to Needs Dev / Todo in WordPress 6.4 Editor Tasks Oct 25, 2023
@t-hamano t-hamano added the Browser Issues Issues or PRs that are related to browser specific problems label Oct 26, 2023
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Oct 27, 2023
@github-project-automation github-project-automation bot moved this from Needs Dev / Todo to Done in WordPress 6.4 Editor Tasks Oct 27, 2023
@SiobhyB SiobhyB removed the [Status] In Progress Tracking issues with work in progress label Oct 28, 2023
@tomandersen
Copy link

Is this happening again? I have this exact problem on Version 17.4.1 Safari desktop, and WordPress 6.5.3. Only on safari desktop, and toggling the PDF "Show inline embed " OFF fixes the problem.

@ironprogrammer
Copy link
Contributor

I've since updated to Safari 17.5 and cannot reproduce the frontend inline embed issue (testing 6.5.3/trunk with GB on/off).

HOWEVER, there is still a rendering issue in the editor after toggling "Show inline embed" off and back on (as noted in #55493 (comment) above). Since the originally reported issue and patch focused on the frontend, I've opened a separate ticket that focuses on the backend behavior, #62120.

@annezazu
Copy link
Contributor

Reopening this as I cannot get a PDF to show a preview in both chrome and safari using WP 6.6.1 and Gutenberg 19.1. I'm using a simple WordPress playground setup and it just shows as an empty frame both in the editor and on the front end:
Screenshot 2024-09-10 at 3 28 39 PM

@annezazu annezazu reopened this Sep 10, 2024
@annezazu annezazu changed the title [Block] File: Embedded PDF fails to render in Safari [Block] File: Embedded PDF fails to render Sep 10, 2024
@ironprogrammer
Copy link
Contributor

Hi, @annezazu 👋🏻 I confirmed that in Playground, the embed isn't showing up as you've reported. This looks like that might be related to WordPress/wordpress-playground#1314, where the iframe with the embed is blocked by Chrome and Safari.

However, for a fresh local install of 6.6.2 w/ and w/o Gutenberg, the PDF does appear for me in the editor and front end:

demo of pdf embed on fresh local 6.6.2 install

Should this be closed back up?

@annezazu
Copy link
Contributor

Amazing sleuthing. Foiled again by Playground. Yes, closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] File Affects the File Block Browser Issues Issues or PRs that are related to browser specific problems [Type] Bug An existing feature does not function as intended
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

9 participants