Page MenuHomePhabricator

Uncaught TypeError: n.closest is not a function
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

On beta, I am seeing javascript errors:

Uncaught TypeError: n.closest is not a function
    ze https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1
    js https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1
    js https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1
    n https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1
    <anonymous> https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1
    <anonymous> https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1
index.js:1:38014
    ze https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1
    (Async: EventListener.handleEvent)
    js https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1
    js https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1
    n https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1
    <anonymous> https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1
    <anonymous> https://wikidata.beta.wmflabs.org/w/extensions/Popups/resources/dist/index.js?0d5d7:1

This seems to happen on most pages I have tested whenever I tab away or the page loses focus.

I have only seen this happen on Firefox so far. I cannot reproduce on Chromium.

Steps to reproduce problem
  1. On Firefox, go to a page on beta (e.g. https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page)
  2. Open devtools
  3. Click anywhere on the page (not a link) to give it focus
  4. Move to another tab or click the browser's navigation URL

Expected behavior: No error
Observed behavior: See the above error in the logs

Environment

Browser: Firefox 102 Debian and Firefox 113 Windows 11 (emulated)
Wiki(s): various beta including https://en.wikipedia.beta.wmflabs.org MediaWiki 1.41.0-alpha (456b507) 06:51, 15 May 2023. Previews – (de881b7) 06:33, 15 May 2023.

Screenshots

Event Timeline

Change 919851 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/Popups@master] Fixes: Uncaught TypeError: n.closest is not a function

https://gerrit.wikimedia.org/r/919851

Change 919851 merged by jenkins-bot:

[mediawiki/extensions/Popups@master] Fixes: Uncaught TypeError: n.closest is not a function

https://gerrit.wikimedia.org/r/919851

Jdlrobson claimed this task.
Jdlrobson subscribed.

Thanks for the report!