`sanitizeHtml` in src/sanitizer.js is causing visual diff JS errors (started with prod push)
See original GitHub issueSee discussion at https://github.com/ampproject/amphtml/pull/13333#issuecomment-363918699
This started failing on master with this error:
/home/travis/.rvm/gems/ruby-2.4.1/gems/poltergeist-1.17.0/lib/capybara/poltergeist/browser.rb:384:in `command': One or more errors were raised in the Javascript code on the page. If you don't care about these errors, you can ignore them by setting js_errors: false in your Poltergeist configuration (see documentation for details). (Capybara::Poltergeist::JavascriptError)
Removing "class" attribute with invalid value in <amp-img class="i-amphtml-element i-amphtml-notbuilt amp-notbuilt">.
Removing "class" attribute with invalid value in <amp-img class="i-amphtml-element i-amphtml-notbuilt amp-notbuilt">.
at https://cdn.ampproject.org/v0.js:2 in pa
Removing "class" attribute with invalid value in <amp-img class="i-amphtml-element i-amphtml-notbuilt amp-notbuilt">.
Removing "class" attribute with invalid value in <amp-img class="i-amphtml-element i-amphtml-notbuilt amp-notbuilt">.
at https://cdn.ampproject.org/v0.js:2 in pa
Removing "class" attribute with invalid value in <amp-img class="i-amphtml-element i-amphtml-notbuilt amp-notbuilt">.
Removing "class" attribute with invalid value in <amp-img class="i-amphtml-element i-amphtml-notbuilt amp-notbuilt">.
at https://cdn.ampproject.org/v0.js:2 in pa
Removing "class" attribute with invalid value in <amp-img class="i-amphtml-element i-amphtml-notbuilt amp-notbuilt">.
Removing "class" attribute with invalid value in <amp-img class="i-amphtml-element i-amphtml-notbuilt amp-notbuilt">.
at https://cdn.ampproject.org/v0.js:2 in pa
from /home/travis/.rvm/gems/ruby-2.4.1/gems/poltergeist-1.17.0/lib/capybara/poltergeist/browser.rb:39:in `visit'
from /home/travis/.rvm/gems/ruby-2.4.1/gems/poltergeist-1.17.0/lib/capybara/poltergeist/driver.rb:99:in `visit'
from /home/travis/.rvm/gems/ruby-2.4.1/gems/capybara-2.17.0/lib/capybara/session.rb:274:in `visit'
from build-system/tasks/visual-diff.rb:288:in `block (2 levels) in generate_snapshots'
from build-system/tasks/visual-diff.rb:281:in `each'
from build-system/tasks/visual-diff.rb:281:in `block in generate_snapshots'
from build-system/tasks/visual-diff.rb:275:in `each'
from build-system/tasks/visual-diff.rb:275:in `generate_snapshots'
from build-system/tasks/visual-diff.rb:250:in `run_visual_tests'
from build-system/tasks/visual-diff.rb:433:in `main'
from build-system/tasks/visual-diff.rb:441:in `<main>'
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (12 by maintainers)
Top Results From Across the Web
Build is failing for sanitize html when running ng build command
I am using angular version 8. I tried with different version of sanitize html such as ver 2.3.0 (latest) and 2.1.1 but got...
Read more >sanitize-html - npm
Clean up user-submitted HTML, preserving allowlisted elements and allowlisted attributes on a per-element basis. Latest version: 2.8.1, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@choumx I’ve just switched the visual tests from phantomJS to headless chrome.
Yeah, we use PhantomJS. See the link under https://github.com/ampproject/amphtml/blob/master/contributing/DEVELOPING.md#visual-diff-tests.
I guess there are two questions to answer: