gicmo / gamemode-extension

GNOME Shell extension for Feral Interactive's GameMode
GNU Lesser General Public License v2.1
148 stars 17 forks source link

Fedora 39 javascript error #72

Closed RobusTetus closed 8 months ago

RobusTetus commented 8 months ago

Upon turning on the extension through the GNOME Extensions app, error message shows up reading "import declarations may only appear at top level of a module".

The settings of extension gamemode@christian.kellner.me had an error:

SyntaxError: import declarations may only appear at top level of a module

Stack trace:

@file:///usr/share/gnome-shell/extensions/gamemode@christian.kellner.me/prefs.js:1:24
_init/GLib.MainLoop.prototype.runAsync/</<@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:266:34
fjsevilla-dev commented 8 months ago

Hi @RobusTetus, Fedora 39 uses GNOME 45 which has brought important changes regarding extensions, the main one being that GNOME Shell 45 moved to ESM (which is the reason for the error you mention).

The version available in extensions.gnome.org is not compatible with Gnome 45, and, unlike previous versions, adding the new version to metadata.json or disabling compatibility checking is not enough. To make the extension compatible with GNOME 45 we have to make code changes that break backwards compatibility.

There is an open issue about this topic; GNOME 45 support. If you want to use the extension on Fedora 39, you can build from source and install the port to GNOME 45 in my fork, until Gicmo can update the extension to a newer version. See my comment on this issue to see how to do it.

If you have any problems let me know.

fjsevilla-dev commented 8 months ago

Duplicate of #70