Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome is logging [Violation] errors in verbose console mode #1795

Closed
etpinard opened this issue Jun 16, 2017 · 29 comments
Closed

Chrome is logging [Violation] errors in verbose console mode #1795

etpinard opened this issue Jun 16, 2017 · 29 comments
Labels
bug something broken

Comments

@etpinard
Copy link
Contributor

etpinard commented Jun 16, 2017

First reported https://community.plot.ly/t/violation-at-console/4518/7

To see it, open up https://codepen.io/etpinard/pen/ZyLQYy and turn on Verbose mode

image

The error message points to this line in dragbox.js.

[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. 
Consider marking event handler as 'passive' to make the page more responsive.

Observed in Chrome 59 and 58.


Anyone know what this is about?

@etpinard etpinard added the bug something broken label Jun 16, 2017
@rreusser
Copy link
Contributor

rreusser commented Jun 16, 2017

I got the sense maybe they just added this to escalate the awareness of this general issue. I think it has to do with whether scrolling bubbles up to the window and then executes the callback or whether it executes the callback and then bubbles up to the window. Presumably it's more expensive UI-responsiveness-wise to block scrolling on your custom callback. Or something. See: https://developers.google.com/web/updates/2016/06/passive-event-listeners

@etpinard
Copy link
Contributor Author

Related to #1240

@rreusser
Copy link
Contributor

Let's see… this is a pretty good description of how to detect and apply it: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md

@etpinard
Copy link
Contributor Author

cc @dfcreative , which might know what this is about.

@efaden
Copy link

efaden commented Sep 5, 2017

Did this ever get fixed...? My events are crashing when I try to perform some logic... I just get TONS of events.

@dy dy self-assigned this Sep 5, 2017
@etpinard
Copy link
Contributor Author

etpinard commented Sep 5, 2017

@dfcreative you're going for this?

@brian428
Copy link

brian428 commented Dec 12, 2017

Any thoughts on getting this fixed? We're showing multiple charts on the screen at once and these non-passive listener violations are flooding the console.

FYI, doing this is explained in detail at: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md

image

@etpinard
Copy link
Contributor Author

Unfortunately, this ticket fell off our short-term priority list. We'll gladly accept PRs from whoever is comfortable for the specs mentioned above.

In the meantime, the only workaround I can propose is to turn off Chrome's verbose logging level.

@etpinard
Copy link
Contributor Author

Interesting report in https://community.plot.ly/t/scrollzoom-doesnt-work-in-chrome/7356 that might be related to this ticket.

@dy
Copy link
Contributor

dy commented Jan 15, 2018

I am not sure we can fix that. In both cases where we attach event listener (scrollZoom and touch panning), we need it to block screen scrolling, therefore we cannot make it passive. In fact, the scenario of panning/zooming is explicitly explained here.
I'd suggest closing this.

@etpinard
Copy link
Contributor Author

Ok. We can't just close this as clearly some people are finding this annoying.

I wonder if there's a way to turn off the those console warning without altering the functionality.

@dy
Copy link
Contributor

dy commented Jan 15, 2018

#2251 fixes that, although exposes event listener on DOM node.

@oscar-broman
Copy link

There is also a dependency on mouse-wheel, which has not been patched.

It is used in src/plots/gl3d/camera.js, for example.

@jacobq
Copy link

jacobq commented Mar 14, 2018

Was this closed because it was fixed or because it's being tracked in #1240?
I am still seeing violation warnings in the console with plotly.js v1.35.2 that look like this:

plotly.js:nnn [Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

@etpinard
Copy link
Contributor Author

@jacobq we attempted a fix in #2251, so that's why thing think is closed.

Can you please share a reproducible example to help us debug?

@jacobq
Copy link

jacobq commented Mar 14, 2018

I am seeing it in an electron v2.0.0-beta.1 app, which uses Chrome 61. (Happens when I mousedown on a plot.) However, I haven't been able to reproduce it in a browser yet. It's possible that it's actually being caused by an extension or something. I can't spend more time playing with it today, but if I am able to come up with a simple jsbin demo for you later then I'll be sure to share it here.

@oscar-broman
Copy link

My reply clearly states the root of the problem:
https://github.com/mikolalysenko/mouse-wheel

Look at the bottom of wheel.js in that repo.

@jacobq
Copy link

jacobq commented Mar 14, 2018

@oscar-broman I don't think that would explain the message I encountered though, right? In my case it was regarding touchstart rather than wheel events.

@etpinard
Copy link
Contributor Author

Right and mouse-wheel is only used in gl3d and pre-regl gl2d graphs. Perhaps @jacobq discovered another problematic case.

@jacobq
Copy link

jacobq commented Mar 14, 2018

OK, I broke my own promise and spent more time digging into this one.
Minimal demo here:
https://github.com/jacobq/electron-plotly-hello-world
Since the exact same app doesn't seem to generate these warnings when opened in Chrome 64 (see non-electron branch),
I think this is something related to Electron (it could still be between Chrome 61 and 64 -- I don't have an older Chrome instance handy to check -- but I doubt that's it).

@etpinard
Copy link
Contributor Author

Ok thanks! I guess the least I can do at this stage is to reopen this ticket.

@etpinard etpinard reopened this Mar 14, 2018
@jacobq
Copy link

jacobq commented Mar 14, 2018

👍 Also feel free to clone and run my demo to see it for yourself. Maybe it will be more obvious to you.
I don't know if this is truly related to it but I'm adding a link here just in case: electron/electron#8725

@alexandertu
Copy link

Any updates on this?

All examples of choropleth from https://plot.ly/javascript/choropleth-maps generates multiple messages:

[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

My version of Chrome is 66. The messages are generated when I double click on any country.
However, the example with Mapbox doesn't generate any messages...

@boyswan
Copy link

boyswan commented Oct 15, 2018

Also wondering the status of this!

@etpinard etpinard unassigned dy Oct 25, 2018
@jonborchardt
Copy link

Also wondering the status of this!

@bikramtpa
Copy link

also wondering

@dy
Copy link
Contributor

dy commented Feb 12, 2020

Blocked by mikolalysenko/mouse-wheel#7

@jackparmer
Copy link
Contributor

This issue has been tagged with NEEDS SPON$OR

A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

Sponsorship range: $5k-$10k

What Sponsorship includes:

  • Completion of this feature to the Sponsor's satisfaction, in a manner coherent with the rest of the Plotly.js library and API
  • Tests for this feature
  • Long-term support (continued support of this feature in the latest version of Plotly.js)
  • Documentation at plotly.com/javascript
  • Possibility of integrating this feature with Plotly Graphing Libraries (Python, R, F#, Julia, MATLAB, etc)
  • Possibility of integrating this feature with Dash
  • Feature announcement on community.plotly.com with shout out to Sponsor (or can remain anonymous)
  • Gratification of advancing the world's most downloaded, interactive scientific graphing libraries (>50M downloads across supported languages)

Please include the link to this issue when contacting us to discuss.

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests