question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`sanitizeHtml` in src/sanitizer.js is causing visual diff JS errors (started with prod push)

See original GitHub issue

See 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:closed
  • Created 6 years ago
  • Comments:18 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
rsimhacommented, Feb 9, 2018

@choumx I’ve just switched the visual tests from phantomJS to headless chrome.

1reaction
rsimhacommented, Feb 7, 2018

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:

  1. Why is this failing on PhantomJS?
  2. Why did a prod push affect the behavior of a locally built runtime?
Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found