The AMP validator reports two errors for the redirect pages, like this:
FAIL: <path>\index.html
line 1, col 224: The attribute 'http-equiv' may not appear in tag 'meta'. (see undefined)
line 3, col 385: Custom JavaScript is not allowed. (see https://amp.dev/documentation/guides-and-tutorials/learn/validation-workflow/validation_errors/#custom-javascript-is-not-allowed)
Steps to reproduce
Run the AMP validator after building the site files using npm run build
Observe the errors in the console output
Expected behavior
The redirect pages should pass the AMP validation without any errors.
Actual behavior
The redirect pages fail the AMP validation with two errors.
To solve the AMP validation errors in the redirect template, follow these steps:
[ ] Remove the <meta http-equiv="..."> tag. This tag is not allowed in AMP documents, as it can interfere with the AMP cache and the browser's rendering.
[ ] Replace the <script> tag with an <amp-script> tag. This tag allows you to run custom JavaScript in AMP documents, as long as you follow the amp-script guidelines.
[ ] Validate your AMP page again using Google’s Structured Data Testing Tool or the AMP validator.
Description
The AMP validator reports two errors for the redirect pages, like this:
Steps to reproduce
npm run build
Expected behavior
The redirect pages should pass the AMP validation without any errors.
Actual behavior
The redirect pages fail the AMP validation with two errors.
Environment
Potential solution
To solve the AMP validation errors in the redirect template, follow these steps:
<meta http-equiv="...">
tag. This tag is not allowed in AMP documents, as it can interfere with the AMP cache and the browser's rendering.<script>
tag with an<amp-script>
tag. This tag allows you to run custom JavaScript in AMP documents, as long as you follow the amp-script guidelines.