Open skyhawk14 opened 2 years ago
Hi, check out https://codesandbox.io/s/mystifying-minsky-ijsei4?file=/src/App.js which worked for me. When clicking on the button, it shows the error properly:
Hi @mszylkowski , Thanks for looking at the issue. But for me I am getting this when I tried using the link which you shared.
I am trying this on Chrome Version 104.0.5112.79 (Official Build) (arm64)
That is interesting, I was on Chrome 103 (working) and just updated to Chrome 104 and it stopped working...
This explains its not working in chrome with the latest build but it is not working in other other browsers like safari (Version 15.5 (17613.2.7.1.8)) and in Firefox also. Is there any update happen with validator_wasm.js , are you aware about it? @mszylkowski
Found a way to fix this temporarily: const instance = await amphtmlValidator.getInstance("https://cdn.ampproject.org/v0/validator.20211101.deprecated.js");
The underlying error comes from a breakage of the API since https://github.com/ampproject/amphtml/issues/36110. I'll direct this issue towards someone that can fix the validator, and comment on that issue.
I've added a comment that the NPM package doesn't work properly.
FYI:
Another alternative is to directly use the script:
<script src="https://cdn.ampproject.org/v0/validator_wasm.js"></script>
and doing window.amp.validator.init().then(() => {doHereYourStuff})
@mszylkowski Second approach works for me. First approach of using javascript validator we can't do it as it as this is deprecated.
@antiphoton @amaltas do you mind taking a look? It looks like it's been broken since Chrome 104.
Description
Facing issue with amphtml-validator v1.0.35 . While using validateString for validating AMP email it is throwing an error. Few months back this was working fine. Getting below error message. Anyone aware about any recent major change with the package dependency or about the issue which I am getting?
Reproduction Steps
Issue is replicated here: https://codesandbox.io/s/happy-cannon-kdrbxt?file=/src/App.js
Relevant Logs
Browser(s) Affected
No response
OS(s) Affected
No response
Device(s) Affected
No response
AMP Version Affected
No response