Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"global is not defined" error #49

Open
peter-kehl opened this issue Apr 18, 2020 · 5 comments
Open

"global is not defined" error #49

peter-kehl opened this issue Apr 18, 2020 · 5 comments
Labels

Comments

@peter-kehl
Copy link

peter-kehl commented Apr 18, 2020

Touchpad Indicator fails with:

ReferenceError: global is not defined

Stack trace:
  logger@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/lib.js:109:5
  executeCmdSync@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/lib.js:131:9
  _isUsable@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/synclient.js:60:24
  _init@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/synclient.js:45:30
  Synclient@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/synclient.js:40:14
  TouchpadIndicatorSettings@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/prefs.js:43:25
  buildPrefsWidget@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/prefs.js:242:20
  _init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:207:40
  OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
  asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
  run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
  main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
  run@resource:///org/gnome/gjs/modules/script/package.js:222:19
  start@resource:///org/gnome/gjs/modules/script/package.js:206:5
  @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17

I do have many other GNOME extensions, but I've turned them all off, I rebooted, and still the same error. That error shows up in "Extensions" application > locate "Touchpad Indicator" > wheel next to it:
image

Touchpad Indicator has always been failing for me since I've installed it at least a year ago. My system is current Manjaro, GNOME version 3.36.1, X11.

  • Operating System: Manjaro (current - Manjaro does not have a version, since it's a rolling release)

  • Touchpad Indicator extension version: 35

  • Gnome Shell version: GNOME Shell 3.36.1+31+ga6783692c-1 (the most recent that came with Manjaro, but the same problem exists for over a year)

  • Display server: X11

  • Switching method: GSetting or Xinput or Synclient - No idea. Can this be "gsettings-desktop-schemas 3.36.0-1"? Otherwise, if you need this, please elaborate.

  • Installation source: extensions.gnome.org

  • Input Devices (ie. output for cat /proc/bus/input/devices)

    I: Bus=0011 Vendor=0002 Product=0007 Version=01b1
    N: Name="SynPS/2 Synaptics TouchPad"
    P: Phys=isa0060/serio1/input0
    S: Sysfs=/devices/platform/i8042/serio1/input/input32
    U: Uniq=
    H: Handlers=event18 mouse3 
    B: PROP=5
    B: EV=b
    B: KEY=e520 10000 0 0 0 0
    B: ABS=660800011000003
    
  • X input devices (ie. output for xinput list) - I have no xinput command

  • Log file (you can enable logging within the extension settings, "Debug" tab)
    Please upload the log file $HOME/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/touchpad-indicator.log - below and also attached
    touchpad-indicator.log

    2020-04-18T17:18:10.822Z Failed to execute child process “synclient” (No such file or directory)
    2020-04-18T17:18:10.853Z Failed to execute child process “xinput” (No such file or directory)
    2020-04-18T17:34:24.411Z {"name":"ELAN Touchscreen","phys":"usb-0000:00:14.0-4/input0","type":"touchscreen"}
    2020-04-18T17:34:24.413Z {"name":"ELAN Touchscreen","phys":"usb-0000:00:14.0-4/input0","type":"touchscreen"}
    2020-04-18T17:34:24.413Z {"name":"Logitech M185/M225","phys":"usb-0000:00:14.0-6/input1:1","type":"mouse"}
    2020-04-18T17:34:24.414Z {"name":"SynPS/2 Synaptics TouchPad","phys":"isa0060/serio1/input0","type":"touchpad"}
    2020-04-18T17:34:24.417Z Failed to execute child process “synclient” (No such file or directory)
    2020-04-18T17:34:24.424Z Failed to execute child process “xinput” (No such file or directory)
    2020-04-18T17:34:24.428Z Failed to execute child process “xinput” (No such file or directory)
    

Thank you in advance.

@peter-kehl peter-kehl changed the title A very very short summary of the issue "global is not defined" error Apr 18, 2020
@askmrsinh
Copy link
Owner

askmrsinh commented Apr 18, 2020

Please try installing the xorg-xinput package on your system.

@askmrsinh
Copy link
Owner

It seems that the extension fails when trying to log to the system journal. This should not be happening. Try changing global.log(LOG_PREFIX + message); to log(LOG_PREFIX + message); in lib.js file and see if that helps.

@peter-kehl
Copy link
Author

Hi Ashesh,

Thank you for Touchpad Indicator, and for a quick response. Confirming

  • installing xorg-xinput fixed it - the extension worked immediately. However, I'm surprised that this package is needed, since (for me) it uses GSettings.
  • changing global.log to log fixed the error and I can manage its all settings.

It would help the users if you put a note to README.md about installing xorg-xinput - if it will stay as mandatory.

@askmrsinh
Copy link
Owner

askmrsinh commented Apr 19, 2020

Technically, the extension should work even without xinput command being present. However, the functionality would be limited.

There was an enhancement for pre-checking xinput (issue #48). I think the second edit (ie. changing global.log to log) was necessary in your case for the extension to work.
It would be great if you could verify by uninstalling the xorg-xinput package and restarting the gnome shell. In that case I can make the required changes permanent.

@askmrsinh askmrsinh reopened this Apr 19, 2020
@peter-kehl
Copy link
Author

Thank you for the feedback and the direction. I've uninstalled xorg-xinput, re-logged in, but it failed. Logs:

2020-04-19T19:13:45.344Z Failed to execute child process “synclient” (No such file or directory)
2020-04-19T19:13:45.349Z Failed to execute child process “xinput” (No such file or directory)
2020-04-19T19:13:45.355Z Failed to execute child process “xinput” (No such file or directory)

And an error in Touchpad Indicator's settings:

TypeError: comp[1] is undefined
Stack trace:
  _listPointingDevices@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/xinput.js:76:30
  _init@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/xinput.js:46:37
  XInput@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/xinput.js:40:14
  TouchpadIndicatorSettings@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/prefs.js:44:22
  buildPrefsWidget@/home/pkehl/.local/share/gnome-shell/extensions/touchpad-indicator@orangeshirt/prefs.js:242:20
  _init@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:207:40
  OpenExtensionPrefsAsync/<@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:122:28
  asyncCallback@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:132:13
  run@resource:///org/gnome/Shell/Extensions/js/dbusService.js:175:20
  main@resource:///org/gnome/Shell/Extensions/js/main.js:19:13
  run@resource:///org/gnome/gjs/modules/script/package.js:222:19
  start@resource:///org/gnome/gjs/modules/script/package.js:206:5
  @/usr/share/gnome-shell/org.gnome.Shell.Extensions:1:17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants