gjs looks for g_thread_init in libglib-2.0.so
This is an issue that started to occur with the typelibs produced by glib itself and gobject-introspection build against that glib.
The main error is the following:
(gjs:413812): Gjs-CRITICAL **: 20:31:24.152: JS ERROR: GLib.Error g-invoke-error-quark: Could not locate g_thread_init: 'g_thread_init': /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0: undefined symbol: g_thread_init
_init@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:520:5
@file:///home/alatiera/foo.js:5:14
and it's reproduced by doing import GLib from 'gi://GLib'
There's another error with the old import scheme as well const GLib = imports.gi.GLib;
gjs> const GLib = imports.gi.GLib;
resource:///org/gnome/gjs/modules/core/overrides/GLib.js:520:5 uncaught exception: Object
_init@resource:///org/gnome/gjs/modules/core/overrides/GLib.js:520:5
@typein:1:14
@<stdin>:1:42