Page MenuHomePhabricator

Uncaught TypeError: Cannot read properties of null (reading 'toString') when visiting Special:EditWatchlist
Closed, ResolvedPublicBUG REPORT

Description

On the current master/beta (d25c9a0), when visiting Special:EditWatchlist the following error is generated in the js console:

Uncaught TypeError: Cannot read properties of null (reading 'toString')
    at HTMLSelectElement.eval (limitSelectors.js:28:69)
    at jQuery.each (jquery.js:383:19)
    at jQuery.fn.init.each (jquery.js:205:17)
    at module.exports (limitSelectors.js:27:18)
    at HTMLDocument.eval (init.js:8:3)
    at mightThrow (jquery.js:3489:29)
    at process (jquery.js:3557:12)

Doesn't appear to be causing any noticeable faults, but FYI


Derived Requirement

Visiting *Special:EditWatchlist* must not trigger JavaScript runtime errors.
All JavaScript executed on page load, including logic in limitSelectors.js, must safely handle null or missing values and must not throw uncaught exceptions.
The page must load cleanly with no console errors, regardless of user state or watchlist configuration.

Test Steps

Test Case 1: Verify no JavaScript errors occur when loading Special:EditWatchlist

  1. Log in to the wiki.
  2. Open browser developer tools and switch to the Console tab.
  3. Navigate to *Special:EditWatchlist*.
  4. Observe the console output during and after page load.
  5. ✅❓❌⬜ AC1: Confirm no uncaught JavaScript errors are logged, including errors related to calling toString() on null.

Test Case 2: Verify page loads correctly with modified watchlist settings

  1. Modify watchlist settings (e.g., change limits, filters, or preferences if available).
  2. Navigate again to *Special:EditWatchlist*.
  3. Observe the console output.
  4. ✅❓❌⬜ AC2: Confirm JavaScript executes safely with non-default values and no uncaught errors occur.

Test Case 3: Verify error does not reappear after page refresh

  1. While on *Special:EditWatchlist*, refresh the page.
  2. Monitor the JavaScript console.
  3. ✅❓❌⬜ AC3: Confirm the Cannot read properties of null (reading 'toString') error does not appear after refresh.

QA Results -Beta

ACStatusDetails
1T412812#11466858
2T412812#11466858
3T412812#11466858

Details

Event Timeline

Change #1218767 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/core@master] Set missing JS config var for the CodexTablePager

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

Change #1218767 merged by jenkins-bot:

[mediawiki/core@master] Set missing JS config var for the CodexTablePager

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

Samwilson moved this task from Ready for Dev to QA on the Community-Tech (Fox Squad) board.
Samwilson added a subscriber: GMikesell-WMF.

I'm not sure what the QA plans are for T410338 (to which this task belongs). So @GMikesell-WMF feel free to just close this if it's out of scope!

@Samwilson Confirmed no Uncaught TypeError: Cannot read properties of null (reading 'toString') when visiting Special:EditWatchlist, as seen in the screenshot and videos. I will mark this as Resolved. Thanks for all your work!

Test Result - Beta

Status: ✅ PASS
Environment: beta- 1.46.0-alpha (b7d0aef) 19:07, 16 December 2025
OS: macOS Tahoe 26.1
Browser: Chrome 142
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify no JavaScript errors occur when loading Special:EditWatchlist

  1. Log in to the wiki.
  2. Open browser developer tools and switch to the Console tab.
  3. Navigate to *Special:EditWatchlist*.
  4. Observe the console output during and after page load.
  5. ✅ AC1: Confirm no uncaught JavaScript errors are logged, including errors related to calling toString() on null.

2025-12-16_16-12-21.png (932×1 px, 305 KB)

Test Case 2: Verify page loads correctly with modified watchlist settings

  1. Modify watchlist settings (e.g., change limits, filters, or preferences if available).
  2. Navigate again to *Special:EditWatchlist*.
  3. Observe the console output.
  4. ✅ AC2: Confirm JavaScript executes safely with non-default values and no uncaught errors occur.

Test Case 3: Verify error does not reappear after page refresh

  1. While on *Special:EditWatchlist*, refresh the page.
  2. Monitor the JavaScript console.
  3. ✅ AC3: Confirm the Cannot read properties of null (reading 'toString') error does not appear after refresh.

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.