Closed Bug 1951587 Opened 17 days ago Closed 16 days ago

Newtab minor console error related to wallpaper v1 removal

Categories

(Firefox :: New Tab Page, defect)

defect

Tracking

()

VERIFIED FIXED
138 Branch
Tracking Status
firefox137 --- verified
firefox138 --- verified

People

(Reporter: thecount, Assigned: thecount)

References

Details

Attachments

(2 files)

Seeing this error "JavaScript error: resource://newtab/data/content/activity-stream.bundle.js, line 13454: TypeError: undefined has no properties"

Looks like this is due to https://searchfox.org/mozilla-central/source/browser/extensions/newtab/content-src/components/Base/Base.jsx#435-436

        // Grab the contrast of the currently displayed wallpaper.
        const { theme } =
          this.state.colorMode === "light" ? lightWallpaper : darkWallpaper;

Essentially if the user has no wallpaper set, lightWallpaper/darkWallpaper are undefined.

      let lightWallpaper;
      let darkWallpaper;

Preciously they would be empty strings in this case, which is also not correct, and probably why we didn't notice this error.

The console error itself is also harmless, currently, because the rest of the code in this function isn't necessary for the case of no wallpaper being set, but we should clear it up anyway.

We should fix it with something like this:

      let lightWallpaper = {};
      let darkWallpaper = {};
Pushed by sdowne@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a8655f19a3c4 Newtab fixing minor console error r=home-newtab-reviewers,maxx
Status: NEW → RESOLVED
Closed: 16 days ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
Attachment #9470147 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: Users will see a console error on New Tab page
  • Code covered by automated testing: yes
  • Fix verified in Nightly: no
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: Please see the Bugzilla ticket for steps to reproduce
  • Risk associated with taking this patch: Low
  • Explanation of risk level: This patch assigns a default value to a variable in JS to remove a console error.
  • String changes made/needed: None
  • Is Android affected?: no
Flags: qe-verify+
QA Whiteboard: [qa-triaged]
Attachment #9470147 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

I have verified that this issue is no longer reproducible using the latest Firefox Nightly 138.0a1 - Build ID: 20250305205032 and Firefox Beta 137.0b3 - Build ID: 20250306083404 (downloaded from treeherder) installed on Windows 10 x64, macOS 15.3.1, and Ubuntu 24.04. I can confirm that after following the steps from here the JavaScript error: resource://newtab/data/content/activity-stream.bundle.js, line 13454: TypeError: undefined has no properties error is no longer displayed in the Browser Console.

Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: