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

a-scene Chrome non-passive violation warnings for touchmove and touchstart event handlers #5510

Open
mitchallen opened this issue Apr 8, 2024 · 5 comments · May be fixed by #5511
Open

a-scene Chrome non-passive violation warnings for touchmove and touchstart event handlers #5510

mitchallen opened this issue Apr 8, 2024 · 5 comments · May be fixed by #5511

Comments

@mitchallen
Copy link
Contributor

mitchallen commented Apr 8, 2024

Description:

For a simple scene, Chrome is logging these warnings to the console:

[Violation] Added non-passive event listener to a scroll-blocking 'touchmove' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
look-controls.js:163 [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

The error references: https://www.chromestatus.com/feature/5745543795965952

Links referred to in console for 1.5.0:

  • A-Frame Version: 1.5.0
  • Platform / Device: Google Chrome Version 123.0.6312.107 (Official Build) (arm64)
  • Reproducible Code Snippet or URL:

I think all you need to reproduce it is a <a-scene /> - but here's an example using look-controls too:

    <a-scene>
        <a-assets>
            <!-- TODO -->
        </a-assets>
        <a-entity id="rig" position="0 0 0">
            <a-camera id="camera" look-controls="enabled: true"></a-camera>
        </a-entity>
        <a-plane position="0 0 0" rotation="-90 0 0" width="4" height="4" color="#222222"></a-plane>
        <a-sky color="#333333"></a-sky>
    </a-scene>
@mrxz
Copy link
Contributor

mrxz commented Apr 8, 2024

Thanks for reporting, interestingly enough I wasn't able to reproduce the warnings locally only in deployed versions. In any case, I've created a PR that sets the passive flag appropriately for every touch/scroll event listener (#5511). Note that several of them aren't passive, but the warning should still be gone with this change.

@dmarcos
Copy link
Member

dmarcos commented Apr 8, 2024

Interesting. I can't see the warnings on Chrome 123 for Mac (neither locally served or deployed versions). It looks warnings should have been seen since Chrome 51. What should I do to reproduce?

@mrxz
Copy link
Contributor

mrxz commented Apr 8, 2024

What should I do to reproduce?

@dmarcos What worked for me was on desktop Chrome 122 visiting https://aframe.glitch.me/, opening the dev console and then refreshing. They didn't show up for me when opening the dev tools after page load, nor did they show up on Quest or Android smartphone with remote debugging. And never showed up locally for some reason. Hope this helps, no idea why this warning is so elusive.

@dmarcos
Copy link
Member

dmarcos commented Apr 8, 2024

Can't reproduce either on the glitch. Would be interesting to understand a bit more.

@mrxz
Copy link
Contributor

mrxz commented Apr 8, 2024

Do you have the "Verbose" log level enabled? Just noticed that despite their warning colour/semantic, they are logged with the verbose level 😐
non-passive

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

Successfully merging a pull request may close this issue.

3 participants