Badly Documented Upgrade from Warning to Error
See original GitHub issueInformation
The new warning takes this pattern
The tag 'TAG_HERE' is missing or incorrect, but required by the 'TAG_HERE extension .js script'. This will soon be an error. (see https://www.ampproject.org/docs/reference/extended/TAG_HERE.html)
Firstly, none of my tags or incorrect. I know this because the tag type it warns me about is no where on the page. That means it must be missing. I think this should be a separate warning as they are very different issues.
Secondly, this is a pretty serious change and the documentation provided neither has a date for this upgrade to error nor details explaining what exactly the change is. It just has the standard custom element documentation (for example)
From what I’ve ascertained, the issue is that I’ve included a custom element script and then never created an instance of that custom element tag.
This is inconvenient, as it means developers must know every piece of content on the page before render time and then choose to only dynamically import the custom element scripts that will occur on the page.
I understand and accept that developer convenience is not a driving principle of AMP, but we must at least be given an explanation of the change and a date of deprecation/error-upgrade before such an intense warning is given so that we may have ample time to update our applications.
This update would cause every single AMP page our site currently serves to start error’ing (10s of thousands), not just a select few like usual with upgrades. We currently have nearly every AMP page showing this warning.
When is this going into effect? Is my understanding of the warning correct?
How do we reproduce the issue?
http://www.refinery29.com/amp/japanese-decora#development=1 You can view the console and see these warnings about the element being missing after the script being imported. This never used to be the case.
More abstractly
- Create AMP valid page which imports a custom element script (say, amp-anim)
- Do not create an instance of the AMP HTML custom element (no
<amp-anim>
on page) - See warnings
- Create instance of
<amp-anim>
- Warning disappears
What browsers are affected?
All
Which AMP version is affected?
Current, which is 1483661191373
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Agreed. I’ll soon be changing the error message to (using youtube as an example):
The extension 'amp-youtube extension .js script' was found on this page, but is unused (no 'amp-youtube' tag seen). This may become an error in the future.
@Gregable Thanks for the information. Our system is having the same problem: Every AMP on our site is valid except for this new warning, so it’s nice to know there will be plenty of time to fix this if it really does become an error.
I started a topic about this in Google Groups, and Guilherme mentioned the cache could simply remove unneeded extension scripts and serve the page without them.
Any idea about whether you’re gonna do that instead? I’m just a little concerned about whether this warning really will become an error - we could update our system to dynamically check the extension scripts and only include the needed ones, but in our case that would probably be worse for performance, not better, due to the architecture of our system (we use Java Server Pages, and currently the head of an AMP is always rendered before the body).