Closed Bug 1514170 Opened 6 years ago Closed 6 years ago

$(...)[0] is undefined in panel.js:121:5

Categories

(Webtools :: Searchfox, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: freddy, Assigned: freddy)

Details

Attachments

(1 file)

I get this error in the console: > TypeError: $(...)[0] is undefined[Learn More] panel.js:121:5 The code around the error is as follows: > // If the user toggles the checkbox let's update the state accordingly. > $('#panel-accel-enable')[0].addEventListener('change', () => { > var newState = ($('#panel-accel-enable')[0].checked); > updateAccelerators(newState); > });
Attached file GitHub Pull Request
Assignee: nobody → fbraun
Status: NEW → ASSIGNED
Attachment #9031369 - Flags: review?(kats)
What URL are you seeing this on? The panel.js code should only be getting included on patches that have the checkbox. If the checkbox isn't there it might be a different bug somewhere.
Flags: needinfo?(fbraun)
I get it on <https://searchfox.org/> directly
Flags: needinfo?(fbraun)
So I think removing panel.js from https://github.com/mozsearch/mozsearch/blob/dbfae5e0817254ba3b043ad482f55d6cae251e06/scripts/output.js#L137 would work too since I believe that file is only used by pages that don't actually have panels. But I guess in the future we might want to add panels there too so the approach in your patch is fine too.

This landed a while ago

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: