amphtml
amphtml copied to clipboard
[amp-twitter] validation error when using data-theme without data-tweetid
What's the issue?
As mentioned in amp-twitter attributes reference, we can use one of the following attributes to determine the type of the amp-twitter component:
- data-tweetid
- data-momentid
- data-timeline-source-type
I've used the following code to show the timeline of our Twitter account:
<amp-twitter width="1"
height="5"
layout="responsive"
data-timeline-source-type="profile"
data-timeline-user-id="143531181"
data-theme="dark"
data-chrome="noheader, nofooter, noscrollbar">
</amp-twitter>
But I've received the following validation error:
The attribute 'data-tweetid' in tag 'amp-twitter' is missing or incorrect, but required by attribute 'data-theme'.
Even if I added the data-tweetid, it will show this error:
Mutually exclusive attributes encountered in tag 'amp-twitter' - pick one of ['data-momentid', 'data-timeline-source-type', 'data-tweetid'].
How do we reproduce the issue?
- Open the AMP [Playground].
- Select the amp-twitter template.
- Paste the previous code in the body tag.
- You will get the validation error.
What browsers are affected?
I'm using Google Chrome 71.0.3578.98 (Official Build) (64-bit)
just an omission for our part.