Leleat / create-gnome-extension

Moved to https://gitlab.gnome.org/World/javascript/create-gnome-extension
GNU General Public License v2.0
1 stars 0 forks source link

Preferences Window Error #52

Closed dagimg-dot closed 1 month ago

dagimg-dot commented 1 month ago

After scaffolding the extension I went to the preferences page for the extension and got the following error with stacktrace.

The settings of extension hello@example.com had an error:
TypeError: Object 0x3d2713f11770 is not a subclass of GObject_Object, it's a Promise

Stack trace:
  _wrapWidget@resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js:52:15
  fillPreferencesWindow@resource:///org/gnome/Shell/Extensions/js/extensions/prefs.js:37:27
  _loadPrefs@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:41:18
  async*_init@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:26:14
  ExtensionPrefsDialog@resource:///org/gnome/Shell/Extensions/js/extensionPrefsDialog.js:17:4
  OpenExtensionPrefsAsync@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:139:33
  async*LaunchExtensionPrefsAsync@resource:///org/gnome/Shell/Extensions/js/extensionsService.js:126:14
  _handleMethodCall@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:373:35
  _wrapJSObject/<@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:408:34
  _init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34

Caused by: Error: This JS object wrapper isn't wrapping a GObject. If this is a custom subclass, are you sure you chained up to the parent _init properly?
Leleat commented 1 month ago

Ah, I made the functions async in the TypeScript template which is only supported in the upcoming GNOME version (47). Weirdly, I did it correctly in the JS template.

So you can just remove the async from the method in the prefs.js file.

But yeah, I do need to add versioning (https://github.com/Leleat/create-gnome-extension/issues/6) to the project. While generally the API for GNOME extensions system doesn't change, it defintely is needed for the types.