Skip to content

Lighthouse audit fails with no-unload-listeners #252

Open
@mkallies

Description

Is your feature request related to a problem? Please describe.
We recently installed the React SDK. We run lighthouse-ci in our CI pipeline and it failed due to no-unload-listeners.

Describe the solution you'd like
Based off of https://web.dev/bfcache/#never-use-the-unload-event, pagehide event is the recommended event since it's triggered in all cases where unload is triggered.

Describe alternatives you've considered
For the time being we can ignore this error.

Additional context

Never add an unload event listener! Use the pagehide event instead. Adding an unload event listener will make your site slower in Firefox, and the code won't even run most of the time in Chrome and Safari.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions