Archived topic
AMP fault after updating
16 replies · Started by Ivan on October 28, 2021
After upgrading to GeneratePress 3.10 and GP Premium 2.10 I got AMP faults.
Invalid value for width</ property: auto
and
MISSING_REQUIRED_PROPERTY_VALUE
After I uploaded your recent AMP for GP plugin yesterday the fault MISSING_REQUIRED_PROPERTY_VALUE disappeared but the fault Invalid value for width</ property: auto
in still there
The url is: https://www.jozan.net/rug-books/
Regards
Ivan
Hi there,
Is there any other information given with these errors? Both of those are pretty vague and hard to track down without more detail.
Let us know :)
Hi Tom - here is the warning message from AMP
Invalid value for width</ property: auto
Details | Copy to clipboard
HTML attribute
--
Markup Status
Removed
Information
AMP allows a specific set of elements and attributes on valid AMP pages. Learn about the AMP HTML specification. If an element or attribute is not allowed in AMP, it must be removed for the page to be cached and eligible for prerendering.
If all invalid markup is “removed” the page will be served as AMP. However, the impact that the removal has on the page must be assessed to determine if the result is acceptable. If any invalid markup is “kept” then the page will not be served as AMP.
Error code
MISSING_REQUIRED_PROPERTY_VALUE
Element attributes
name viewport
content width=auto
Invalid property
width: auto (required value: device-width)
Node name
content
Parent element
meta
Sources
Does it point to any specific lines in the HTML?
The second error code is saying device-width is the required value for the viewport element, but that's what you have: https://www.screencast.com/t/1k3zDhjYoq
Well - I cam't find more information in the ANP Valuated URL Dasboard - perhaps it is a fault with the ANP plugin.
Very weird. I'm not an AMP expert, but it sounds like it's finding something like this: <meta name="viewport" content="width=auto">
However, that doesn't exist on your page. It might be worth checking with the AMP plugin support team to see if we're looking at the wrong thing.
Hi Tom
Look forward if there is a solution - perhaps it does not matter because the site still is AMP valid but it is annoying with these warnings. The problemed occured in the moment I upgraded to the new version of Genereatepress so there must be some connection.
Regards
Ivan
ps: thanks for the execllent service you always provide.
Hi there,
researching what Tom mentioned, i can't see why that would throw an error.
The only thing that changed in GP related to this was we moved the viewport meta higher up in the <head> of the document.
This shouldn't really matter but can you check with the AMP plugin author if this would have affected it or if there is any other reason why it would create an issue ?
Well - I did some investigations myself and checked one of my sites deactivating AMP and saw that the metatag for a non-amp site should be <meta name="viewport" content="width=device-width, initial-scale=1">
Then I made a hook <meta name="viewport" content="width=device-width, initial-scale=1"> for the Head and published it.
After that the AMP warning message disappeared. But I wonder if this is the right way to solve this problem.
Regards
Ivan
What's weird is that's the default meta tag - you shouldn't need to add it at all (doing so might make it appear twice).
Is the default meta tag changing when you turn on AMP?
Hi Tom
I'm not sure if I really answer the question you are asking but when I look in the soucecode
When AMP is turned on the maetag is
<meta name="viewport" content="width=device-width">
When AMP is turned of I find
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
Regards
Ivan
On https://www.jozan.net AMP is turned on and my workaround is active
and on https://travel.jozan.net AMP is turned off
and on https://arts.jozan.net/ AMP is turned on and I have not activated my workaround and get a AMP warning (AMP removed the fault) and I suppose this means that the viewport not function proberly.
All sites are updated with newest versions of GP, GP premium plugin and GP Amp plugin.
Regards
Ivan
I checked the 2 x Sites that have enabled, and as a comparison checked the AMP for WordPress site:
https://www.screencast.com/t/0aaSLgSEK7
All 3 sites have identical viewport meta as highlighted in red. And looking at the HTML doc attributes they're all running the same AMP version and template setup.
So hard to explain why 1 site throws an error and the other does not, when they have the same setup.
Have you tried clearing any browser/plugin/server caches and clear the cookies on the browser just in case some localStorage is getting in the way of things.
I have cleared all browsers and cache plugins and deactivated cloudflare - this is not what causes the AMP warning.
As mentioned the problem occured when I updated to newest version of GP. After that I got a warning with an AMP fault saying Invalid value for width</ property: auto
When I publish a hook <meta name=”viewport” content=”width=device-width, initial-scale=1″> the AMP warning disappear.
But why the GP update tricker this AMP warning and why the workaround with the hook seems to solve this is a mystery. I wonder if you will recieve more comments from other GP and AMP official plugin users or if it is just a problem in my installation. If this is a general problem I suppose you need to dig deeper but at this moment I think I have a work around that is acceptable.
Regards
Ivan
ps: I get the same AMP warning at my site https://arts.jozan.net (where I have not published the work around hook) with Chrome, Firefox and MS Edge