amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

amp-script nodom error in AMP cache viewer

Open candice-womp opened this issue 6 years ago • 4 comments

What's the issue?

We have an amp-script component with the nodom attribute set up to act as a source for an amp-list. This works perfectly when we view the AMP page directly, but when we view the same AMP page via the Google AMP cache we’re seeing this error message in the console for the nodom amp-script component. As a result, the amp-list component that relies on this amp-script as a source is unable to render. Is this a known bug that will soon be resolved?

How do we reproduce the issue?

Unable to provide a URL to reproduce the issue since this happened with a private project. I've attached a screenshot that shows the error message in the console. image

What browsers are affected?

All browsers.

Which AMP version is affected?

Version 2009252320001

candice-womp avatar Oct 12 '20 16:10 candice-womp

@candice-womp: I just checked a page on the AMP Cache and cannot reproduce the issue. Can you reproduce the error in a shareable way?

samouri avatar Oct 12 '20 21:10 samouri

@candice-womp: on closer inspection, I believe the issue is that you've set layout=container. In order for nodom to work, there must be no layout.

That said, we should probably emit a warning that it is an invalid configuration, as well as have nodom have higher priority over other layouts.

samouri avatar Oct 12 '20 21:10 samouri

Actually, even with using layout=container in conjunction with nodom, I could not reproduce this error. Is it possible you have local css styling with !important that is forcing the width/height to be 0?

samouri avatar Oct 21 '20 21:10 samouri

@candice-womp: I'm going to close this issue and assume your problem is resolved. Please comment again if you are still seeing it!

Thanks

samouri avatar Feb 19 '21 04:02 samouri