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

Error: import declarations may only appear at top level of a module #280

Open
Francewhoa opened this issue May 2, 2024 · 2 comments
Open

Comments

@Francewhoa
Copy link

Francewhoa commented May 2, 2024

Intro

I created this ticket to facilitate communications about pull request #270. I'm assuming that it is easier to resolve a challenge if there is one challenge per ticket.

Steps to reproduce error

  1. Replaced only the file thumbnailsBox.js with commit cb29bcc for gnome-shell-wsmatrix version 38

  2. Using Extension Manager, try activating gnome-shell-wsmatrix version 38 with commit cb29bcc This video shows this step at https://vk.com/video-225763421_456239018

  3. The first challenge is that the extension can't be activated. The number 1 in this screenshot below shows this first challenge.
    Screenshot-342

  4. The second challenge is when trying to activate the extension, this error message is display within Extension Manager import declarations may only appear at top level of a module. The number 2 in this screenshot above shows error message. This video shows this error at https://vk.com/video-225763421_456239018

  5. The needed end result is that users are able to activate the extension without error message. So that this other related challenge is potentitally resolved about Dragging a window to 2nd row or more fails in Overview #274


Used

• gnome-shell-wsmatrix 38 with commit cb29bcc
• Debian 12 Bookworm 64 bits
• GNOME 43.9
Extension Manager 0.4.3
• Wayland


What I tried that did not work

  • Deactivated all GNOME extensions. Except gnome-shell-wsmatrix 38 with commit cb29bcc

  • Fresh GNOME session

  • Restart device

  • Used gnome-shell-wsmatrix 38, replaced only the file thumbnailsBox.js with commit cb29bcc

  • Replaced all files and all folders of gnome-shell-wsmatrix 38. Which included patched file thumbnailsBox.js.

@Francewhoa
Copy link
Author

Francewhoa commented May 2, 2024

Thanks! Unfortunately, I don't see the "import declarations" error message there. Maybe it is reported by some other process. You can search the whole journal by executing journalctl, then entering the / character, typing part of the error message (e.g. import declarations) and finally pressing Enter. This will search the journal for the error message (which could take a while).

Good morning @mzur :)

I'll try to get this "import declarations" error message for you

On question for you below. The logs are very long. I'm trying to narrow down the location of the slippery-fish-elusive "import declarations" error message.

Question. In those steps to reproduce above at #280 (comment) When would this error message be likely be added to the logs? For example:

  • When I open Extension Manager?
  • Or after patching thumbnailsBox.js, during the opening of a new GNOME session?
  • Or when else?

In other words, when does GNOME validate the extension declarations?

@mzur
Copy link
Owner

mzur commented Jun 3, 2024

The extension is loaded when GNOME Shell is started, i.e. after the login screen. You should be able to find the error if you search for the "import declarations" message text in the log. However, once I also encountered an extension error message that didn't show up in the usual gnome-shell log. I don't remember where else I found it, unfortunately. Maybe you could try searching all of journalctl (without argument) if you can't find the message in the gnome-shell log.

You could also try to change the multi-line import here to a single-line import. Maybe this causes issues in a newer GNOME Shell version.

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

No branches or pull requests

2 participants