Lullabot / amp-library

Convert HTML to AMP HTML and report HTML compliance with the AMP HTML specification
Other
381 stars 178 forks source link

Error "The script tag for amp-user-notification is likely included twice in the page". Circular dependency in validator-generated.php #270

Open apugacescu opened 4 years ago

apugacescu commented 4 years ago

What's the issue?

Using Drupal 8 with stable amp module version 2.1 https://www.drupal.org/project/amp/releases/8.x-2.1 and amp-library version 1.1.4

How do we reproduce the issue?

Include amp-user-notification element, the library will attempt to add the dependencies automatically for this custom element. validator-generated.php stores the spec for the amp elements and amp-user-notification has the following dependencies defined $o_994->also_requires_tag = ['amp-analytics extension .js script', 'amp-user-notification extension .js script']; https://github.com/Lullabot/amp-library/blob/master/src/Spec/validator-generated.php#L4257

Which results in two script additions. Tested by removing the second dependency.

What browsers are affected?

All browsers.

Which AMP version is affected?

Using 1.1.4.