-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Bento components sporadically fail to render on Transformed (SSR'ed) AMP pages #35485
Comments
cc @caroqliu |
Given many people will need to update their servers to use the new optimizer transforms, I think we should also solve this in Runtime. The issue is the race between DOM parsing, and the But, children are not guaranteed to be parsed when But that alone doesn't fix it, because the method isn't called before
|
What's the trade off in making client side apply changes for invalid server output? Perhaps I am reading this incorrectly, but if the server was rendering as expected this issue wouldn't occur... correct? This could be a "optimized" versus generic solution if the cost is high to include in the client. |
2 lines of code, it's extremely simple. Because of backreferences in compress, it might be 20 bytes. It might cause some CLS, but the failure mode is display nothing at all which I think is worse.
Correct. |
Makes sense, thanks. Can we document this behavior as well so implementors can avoid the shift via Bento Compiler? |
@CrystalOnScript can you advise on where we should put this documentation? I'm not positive implementers are likely to go to the Bento guide for this type of information. Is there a relevant section under "Optimize and Measure" that we can add to? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Description
I've come across a strange issue where Bento components sporadically fail to render when they appear on some transformed AMP pages (i.e. SSR'ed with AMP Optimizer). I've put together a test case to demonstrate: https://amp-bento-component-ssr-init-fail.glitch.me/
See the following video for the buggy behavior in the third iframe with the heading “With WP Admin Bar w/ SSR”, after I reload the page a couple times:
bento-components-sporadically-fail-to-initialize-with-ssr.mov
This SSR'ed AMP with the WordPress admin bar consistently fails to have the
amp-youtube
andamp-video
Bento components render.The difference between the two is the
i-amphtml-sizer
element. In the working version, it has theslot="i-amphtml-svc"
attribute whereas in the failing version, thisslot
attribute is absent.The markup pre-SSR:
The markup after SSR:
When the WordPress admin bar is present (in which case the SSR'ed Bento components often fail to render), the following changes are present:
There seems like a race condition going on, and it may be that the additional stylesheets and scripts are making the race condition more likely to happen.
Reproduction Steps
Go to https://amp-bento-component-ssr-init-fail.glitch.me/ (and potentially reload the page) to see the third iframe have Bento AMP components that fail to load.
I can reproduce consistently in Chrome, Edge, and Safari. In Firefox I've been able to reproduce the issue less frequently, mainly after doing hard refreshes.
Relevant Logs
No response
Browser(s) Affected
Chrome, Firefox, Safari, Edge
OS(s) Affected
No response
Device(s) Affected
No response
AMP Version Affected
2107170150000
The text was updated successfully, but these errors were encountered: