amphtml: amphtml-validator returns this.sandbox.amp.validator.categorizeError is not a function

##What’s the issue? Running amphtml-validator via command line returns

this.sandbox.amp.validator.categorizeError is not a function

How do we reproduce the issue?

  1. install the latest amphtml-validator package from
  2. run amphtml-validator file.html #this file is attached as file.zip in this ticket. file.html.zip returns: this.sandbox.amp.validator.categorizeError is not a function

What browsers are affected?

amphtml-validator via command line is affected

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 27
  • Comments: 35 (14 by maintainers)

Commits related to this issue

Most upvoted comments

Oh I am going mental over this… [censored…]

my apologies.

Fix published as https://www.npmjs.com/package/amphtml-validator version 1.0.28.

Validator error categories and all the references to amp.validator.categorizeError were removed https://github.com/ampproject/amphtml/pull/25134 validator rollup.

Publishing a updated amphtml-validator npm package now.

FYI as a follow up, the release process for cdn.ampproject.org/v0/validator.js now includes an automated step that runs light verification tests against the latest amphtml-validator NPM version. This would have caught the specific release failure mentioned in this github issue.

This step would not have caught the separate issue with removing support for older Node versions, but that was an explicit decision rather than an unintended bug, which isn’t really what tests are there to catch. The consequences of that decision were not fully understood, but I think we understand them better now.

All interfaces should be returning errors/warnings now. This includes previous versions of NPM (sync back to 1.0.23 if you have node compatibility issues).

Note that all errors are categorized as UNKNOWN. The error category system has retired. For some history, this system categorized all errors into an set of 10 broad enums like “GENERIC” and “AUTHOR_STYLESHEET_PROBLEM”. Note that category is distinct from severity, which is of the set ERROR/WARNING. Severity is still present and unchanged. There was little if any remaining usage of these categories. Google Search console was one of the remaining users, but no longer consumes categories. Any older version of the validator that still consumes categories will now categorize all errors as UNKNOWN. We’ll follow up with fixes to those interfaces to ensure they remove references to categories as well.

@liorbashan, in node_modules/amphtml-validator/index.js on line 279 or something like that.

@rodolphonetto @Timer Sorry you’re still experiencing issues around this change. We’re working on addressing them. Could you verify that this is happening with 1.0.28?

@rodolphonetto Don’t worry! This is still broken despite this issue being closed. We’re trying to work with the AMP team on a resolution that doesn’t leave all users broken!

any plans to support node 8.x? Next.js use it zeit/next.js#9172

Fix for that is pending in #25208.

amphtml-validator version 1.0.27 published. Please update the amphtml-validator dependencies to use latest version.

In future, we will make sure any changes in validator.js do not break nodejs package and/or get caught during the release.

Please reopen the issue if you still see the error, or I missed something. PS: This is my first npm publish.

@jackbillstrom your comments above are violating AMP’s Code of Conduct which aim to promote civil discourse on all AMP channels.

Please ensure that all future comments follow the Code of Conduct. We understand that the current situation is upsetting, however, personally attacking any of our other members is not pushing discussion forward.

@kevva Productive or not, I couldn’t understand on to get passed this bug. Of course I then come with some hard-on questions.

Thus, as you say, bugs always occur but this was just so annoying.

Thanks. 😈