amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

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

Open anuragphadke opened this issue 7 years ago • 35 comments

##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

anuragphadke avatar Oct 22 '19 04:10 anuragphadke

same problem, is there a solution?

Sevenaka avatar Oct 22 '19 04:10 Sevenaka

it seems we need to upgrade to the latest version https://github.com/ampproject/amphtml/commit/7d7b8d6d0ef7767a2b319c7fbd1959dffbc8931e#diff-5185ebf96af6c84dd9d0f25168752664L279

joselcc avatar Oct 22 '19 05:10 joselcc

Tried on 1.0.26 which is the latest and was released 3 days ago, same error.

anuragphadke avatar Oct 22 '19 05:10 anuragphadke

yeah, I still see the old code in v1.0.26, I think they meant to publish v1.0.25

joselcc avatar Oct 22 '19 06:10 joselcc

Man this is really putting me in a bad position, how the f*ck did they manage to do this....

swe-jack avatar Oct 22 '19 07:10 swe-jack

I'm using version 1.0.21 and it's also broken, but it worked a few hours ago.

Jeiwan avatar Oct 22 '19 07:10 Jeiwan

It's broken because amphtml-validator tries to run https://cdn.ampproject.org/v0/validator.js which doesn't contain the said function anymore.

kevva avatar Oct 22 '19 07:10 kevva

all amphtml-validator versions use what is published in https://cdn.ampproject.org/v0/validator.js, categorizeError method was removed here from the validator engine

joselcc avatar Oct 22 '19 07:10 joselcc

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

my apologies.

swe-jack avatar Oct 22 '19 12:10 swe-jack

@jackbillstrom, that's not productive at all. You can still remove the line locally for amphtml-validator in your node_modules folder. That's what I did until they fix it.

Bugs will happen from time to time. You don't have to be a script kiddie on an internship to cause them, even if you work at Google.

kevva avatar Oct 22 '19 12:10 kevva

@kevva , Can you give more details as for what changes can be done locally in node_modules until (or if) they fix this?

liorbashan avatar Oct 22 '19 12:10 liorbashan

@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. :smiling_imp:

swe-jack avatar Oct 22 '19 13:10 swe-jack

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

kevva avatar Oct 22 '19 14:10 kevva

@kevva , Thank you :) This is obviously a temporary solution. Still wondering why would they remove the error documentations from this service, since it was really useful. (more useful than amp.dev documentations :))

liorbashan avatar Oct 22 '19 14:10 liorbashan

What can be done towards the emergence of the amp cache wedding videos for some videos does not work properly at the scales amp. For example ; https://pornoyakala.com/amp/ why this raya gidrdinmi size is not bigger 16/9?

sakinee avatar Oct 22 '19 16:10 sakinee

all amphtml-validator versions use what is published in https://cdn.ampproject.org/v0/validator.js, categorizeError method was removed here from the validator engine

that is unfortunate. there really should be a way to run validation while only depending on local code. filed https://github.com/ampproject/amphtml/issues/25200 to track this.

cpapazian avatar Oct 22 '19 16:10 cpapazian

/cc @Gregable @ampproject/wg-caching

mrjoro avatar Oct 22 '19 16:10 mrjoro

@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.

nainar avatar Oct 22 '19 17:10 nainar

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.

amaltas avatar Oct 22 '19 17:10 amaltas

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.

amaltas avatar Oct 22 '19 20:10 amaltas