tomoyukikashiro / html2amp

html2amp is simple converter from HTML into AMP(Accelerated Mobile Pages).
MIT License
15 stars 15 forks source link

An AMP component 'amp-install-serviceworker' is using an invalid version. Use a valid version of this AMP component. #176

Open rpong opened 2 years ago

rpong commented 2 years ago

We recently received the following issues detected by Google Search Console

1.) An AMP component 'amp-install-serviceworker' is using an invalid version. Use a valid version of this AMP component.

2.) An AMP component 'amp-form' is using an invalid version. Use a valid version of this AMP component.

Upon checking, we have the following Console errors in our AMP Pages:

Failed to load resource: the server responded with a status of 404 () https://cdn.ampproject.org/v0/amp-form-undefined.mjs

Failed to load resource: the server responded with a status of 404 () https://cdn.ampproject.org/v0/amp-install-serviceworker-undefined.mjs

The "undefined" is supposed to be a version.

Upon further digging, there are recent changes to the @ampproject/toolbox-optimizer package that might be related to the issue.

rpong commented 2 years ago

@tomoyukikashiro , pinning the @ampproject/toolbox-optimizer version to 2.3.0 seems to fix the issue for us.

PR: https://github.com/tomoyukikashiro/html2amp/pull/177

PS: I tried 2.8.6 initially which was released few hours ago, but we got the following error/notice in the backend with that version:

AMP Optimizer AutoExtensionImporter ERROR Missing validation rules, cannot auto import extensions

so it seems 2.3.0 is the best fit for now. There seems to be a need to update how html2amp use @ampproject/toolbox-optimizer.