-
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
error "No ampdoc found" reading amp from pwa in shadow dom #17328
Comments
To emulate it's possible to force the showing of a#detail-audio_trigger by changing the visibility from Dev Tools of its ancestors and then click into the icon to reproduce. |
@danielrozenberg would you be able to triage and investigate? |
Did some debugging and found what appears to be a problem with amphtml/extensions/amp-access/0.1/amp-access.js Lines 219 to 230 in a5b415d
One problem appears to be that This works for non-shadow-v0.js since the single doc will be returned. Note that this will also have problems with |
Template failed: [object HTMLDivElement] [object HTMLDivElement]: No ampdoc found for [object HTMLTemplateElement] It looks like at some point the code tries to get the ampdoc for a I'm not exactly certain on this part, but this may be occurring because the same template is trying to be rendered twice. I think this is because the same template exists under two <div amp-access="NOT (showContent)">
..
<section amp-access="NOT (showContent)">
...
<div class="paywall-fixed">
<template amp-access-template type="amp-mustache">...</template>
</div>
...
</section>
</div> and the code is going through and finding the templates within each subtree and ends up bumping into the same template twice. I'm not sure that this will cause an issue even though an error is being reported. I think it might make sense to remove the |
Thanks for your reply @sparhami. I removed amp-access on section tag as you suggested and however it is a good change, but I have jet the same errors in console. |
Thanks for removing the extra amp-access. I can now see that the source of the problem lies here: amphtml/extensions/amp-access/0.1/amp-access.js Lines 508 to 519 in 4c6faff
When the template has been rendered for the first time, it stores the template onto the rendered element for future reference. The second time it comes through to update, it takes the stored template and calls amphtml/src/service/template-impl.js Lines 116 to 119 in 4c6faff
I'll take a look to see how this can be addressed. |
Thanks a lot for your explanation and for your time over this @sparhami and @gilbertococchi ! |
The "No ampdoc found for" error should no longer appear. I am unsure if all the issues are ironed out however (e.g. audio icon) since the test account I have does not appear to have an active subscription. Are there still issues that you see? |
Thanks a lot! We no longer have the error "No ampdoc found for" and so we can close this issue. PS yes in this moment there are some error on audio, but they are ours and we just fixed :) |
We load an amp-page in shadow dom from pwa by an amp-reader component, but we receive an error as soon as you open the page:
Template failed: [object HTMLDivElement] [object HTMLDivElement]: No ampdoc found for [object HTMLTemplateElement]
amp page is visible and some things works fine, but we have errors after some other actions like click/tap on element with event listener like this:
tap:audio-target.scrollTo()
audio-target is an ours element target selector, but we have
Uncaught (in promise) Error: No ampdoc found for [object HTMLHtmlElement]
this is a production affected url (pwa): https://rep.repubblica.it/pwa/generale/2018/08/06/news/gas_esplosivi_benzina_e_vernici_ogni_giorno_10_mila_bombe_vaganti-203552010/
this is the relative original amp page: https://rep.repubblica.it/ws/detail/generale/2018/08/06/news/gas_esplosivi_benzina_e_vernici_ogni_giorno_10_mila_bombe_vaganti-203552010/
In the original amp page all works fine, we have noted this issue since last 3-4 days.
The text was updated successfully, but these errors were encountered: