aleho / gnome-shell-volume-mixer

GNOME Shell Extension allowing separate configuration of PulseAudio devices
https://extensions.gnome.org/extension/858/volume-mixer/
GNU General Public License v2.0
136 stars 32 forks source link

JS ERROR: TypeError: ExtensionUtils.openPrefs is not a function #120

Closed bjornfor closed 4 years ago

bjornfor commented 4 years ago

Hi,

I just tried this extension (version 3.36.6) on NixOS with GNOME 3.36.1 and got this error in the system journal when clicking the "Settings" button from the menu in the corner:

.gnome-shell-wr[2150]: JS ERROR: TypeError: ExtensionUtils.openPrefs is not a function
                                                _addSettingsItem/<@/run/current-system/sw/share/gnome-shell/extensions/shell-volume-mixer@derhofbauer.at/lib/widget/volume.js:248:56
                                                _addButton/<@/run/current-system/sw/share/gnome-shell/extensions/shell-volume-mixer@derhofbauer.at/lib/widget/menuItem.js:176:54
                                                activate@resource:///org/gnome/shell/ui/popupMenu.js:191:14
                                                vfunc_button_release_event@resource:///org/gnome/shell/ui/popupMenu.js:138:14

In the gui nothing happened (well, the menu closed, but I expected some "settings" window to appear).

Everything else seems to work.

aleho commented 4 years ago

Please use the latest version (either from the releases tab) or via extensions.gnome.org and report back if this problem still persists.

bjornfor commented 4 years ago

Sorry, I had a typo. Fixed now. So I am using the latest version of gnome-shell-volume-mixer: 3.36.6.

aleho commented 4 years ago

That's really fishy then. imports.misc.extensionUtils.openPrefs() is the official way to open preferences since 3.36 and should by used by all extensions and works on all systems I tested so far (Debian, Arch, Manjaro).

bjornfor commented 4 years ago

Thanks, that's valuable info. Might be something related to my system then (or NixOS + GNOME in general).

aleho commented 4 years ago

You could bring up Looking Glass (Alt+F2, lg, Enter) and check whether the method exists: imports.misc.extensionUtils.openPrefs().

And also imports.misc.config.PACKAGE_VERSION might be interesting.

bjornfor commented 4 years ago

TL;DR: In the meantime I did another OS upgrade and now have GNOME 3.36.2 (was .1). Problem solved! Clicking "Settings" now opens the settings.

Thanks for the tip about the Looking Glass. Here is the result (when it works):

>>> imports.misc.extensionUtils.openPrefs()
r(0) = <exception Error: openPrefs() can only be called from extensions>
>>> imports.misc.config.PACKAGE_VERSION
r(0) = 3.36.2

(Annoyingly I cannot directly copy from the Looking Glass, and it sits on top of every other window, so it is cumbersome to work with.)

Looking at the git history for NixOS, it seems I was in the middle of a GNOME update. Now it seems fully updated to GNOME 3.36.2. I'm not bothering going back to see what was wrong before. For the archive, I was on https://github.com/NixOS/nixpkgs/commit/5f14d99efed32721172a819b6e78a5520bab4bc6 and upgraded to https://github.com/NixOS/nixpkgs/commit/e15ab2cda754fcbf952ad02ff4c466dd36ba65f8.

bjornfor commented 4 years ago

Thanks, @aleho!

aleho commented 4 years ago

You're welcome! I suspected a half-finished update with some kind of Franken-GNOME, because the JS code is either there or not, there's no way Shell won't provide it starting with 3.36,