Running amphtml-validator via command line returns
this.sandbox.amp.validator.categorizeError is not a function
amphtml-validator via command line is affected
same problem, is there a solution?
it seems we need to upgrade to the latest version https://github.com/ampproject/amphtml/commit/7d7b8d6d0ef7767a2b319c7fbd1959dffbc8931e#diff-5185ebf96af6c84dd9d0f25168752664L279
Tried on 1.0.26 which is the latest and was released 3 days ago, same error.
yeah, I still see the old code in v1.0.26
, I think they meant to publish v1.0.25
Man this is really putting me in a bad position, how the f*ck did they manage to do this....
I'm using version 1.0.21
and it's also broken, but it worked a few hours ago.
It's broken because amphtml-validator
tries to run https://cdn.ampproject.org/v0/validator.js which doesn't contain the said function anymore.
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
Oh I am going mental over this... [censored..]
my apologies.
@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 , Can you give more details as for what changes can be done locally in node_modules until (or if) they fix this?
@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:
@liorbashan, in node_modules/amphtml-validator/index.js
on line 279
or something like that.
@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 :))
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?
all
amphtml-validator
versions use what is published inhttps://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.
/cc @Gregable @ampproject/wg-caching
@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.
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.
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.
1.0.27 requires node 12, so i am still blocked. what's the context on the minimum node version requirement?
Fix for that is pending in #25208.
Fix published as https://www.npmjs.com/package/amphtml-validator version 1.0.28.
any plans to support node 8.x? Next.js use it zeit/next.js#9172
Maybe I'm not so much smart.. but even after updating the package to 1.0.28 I'm still facing the same error... I use it as dependency of next.js amp pages. I went to line 279 as said before and found that code, is it the last version?
Validator.prototype.validateString = function(inputString, htmlFormat) {
const internalResult =
this.sandbox.amp.validator.validateString(inputString, htmlFormat);
const result = new ValidationResult();
result.status = internalResult.status;
for (let ii = 0; ii < internalResult.errors.length; ii++) {
const internalError = internalResult.errors[ii];
const error = new ValidationError();
error.severity = internalError.severity;
error.line = internalError.line;
error.col = internalError.col;
error.message =
this.sandbox.amp.validator.renderErrorMessage(internalError);
error.specUrl = internalError.specUrl;
error.code = internalError.code;
error.params = internalError.params;
result.errors.push(error);
}
return result;
};
@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!
Ahh ok! I thought version 1.0.28 solved all problems, Where can I watch to be updated about that problem?
@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 @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
?
@honeybadgerdontcare 1.0.28
moves the minimum node version to 10, so it is still broken on 8, or any other previous versions.
@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
?
There is no problem, I can wait :)
Yes, I'm still facing the same issue with version 1.0.28, my node version is 12.10.0
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.
For browser interfaces you may need to force reload https://cdn.ampproject.org/v0/validator.js
Thank you for the detailed explanation, distinction between severity and category, and the fix @Gregable et al.
FWIW Next.js CI re-enabled the AMP tests after this began passing again. x-ref https://github.com/zeit/next.js/pull/9162
All working fine right now, thank you so much :)
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.
Most helpful comment
Fix published as https://www.npmjs.com/package/amphtml-validator version 1.0.28.