I’m going through the tutorial for writing shell extensions in TypeScript, and the example provided doesn’t compile.
It fails with a wall of “Duplicate identifier” errors between symbols exported in @girs/...
modules. And a bunch of incompatibilities between ...Paintable
types. The forum only allows images or pdf attachments, so I pasted some of the errors at the end.
Despite the errors, the dist/*.js
files still gets created, so running make install
a second time manages to install the extension.
After installing, the extension enables and disables normally, but trying to access the preferences with gnome-extension prefs ...
crashes with this error screen:
The same issue has been observed by other users on Gnome Extensions matrix chat, and on the TypeScript discord server. It looks to be an actual problem in the example.
Attachments
Attachments
Some of the ...Paintable
errors:
node_modules/@girs/gtk-4.0/gtk-4.0.d.ts:248725:9 - error TS2416: Property 'bind_property' in type 'WidgetPaintable' is not assignable to the same property in base type 'Paintable'.
Type '(source_property: string, target: import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gnome-shell/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Object, target_property: string, flags: import("/home/alvise/Documents/projects/l...' is not assignable to type '(source_property: string, target: import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Object, target_property: string, flags: import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.o...'.
Property '$signals' is missing in type 'import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gnome-shell/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Binding' but required in type 'import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Binding'.
248725 bind_property(
~~~~~~~~~~~~~
node_modules/@girs/gobject-2.0/gobject-2.0.d.ts:3099:9
3099 $signals: Binding.SignalSignatures;
~~~~~~~~
'$signals' is declared here.
node_modules/@girs/gtk-4.0/gtk-4.0.d.ts:248906:9 - error TS2416: Property 'ref' in type 'WidgetPaintable' is not assignable to the same property in base type 'Paintable'.
Type '() => import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gnome-shell/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Object' is not assignable to type '() => import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Object'.
Property '$signals' is missing in type 'import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gnome-shell/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Object' but required in type 'import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Object'.
248906 ref(): GObject.Object;
~~~
node_modules/@girs/gobject-2.0/gobject-2.0.d.ts:3448:9
3448 $signals: Object.SignalSignatures;
~~~~~~~~
'$signals' is declared here.
node_modules/@girs/gtk-4.0/gtk-4.0.d.ts:248921:9 - error TS2416: Property 'ref_sink' in type 'WidgetPaintable' is not assignable to the same property in base type 'Paintable'.
Type '() => import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gnome-shell/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Object' is not assignable to type '() => import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Object'.
Property '$signals' is missing in type 'import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gnome-shell/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Object' but required in type 'import("/home/alvise/Documents/projects/lookout/gnome/lookout@mirolang.org/node_modules/@girs/gobject-2.0/gobject-2.0", { with: { "resolution-mode": "import" } }).GObject.Object'.
248921 ref_sink(): GObject.Object;
Some of the “Duplicate identifiers” errors:
node_modules/@girs/gtk-4.0/node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:3:20 - error TS2300: Duplicate identifier 'HarfBuzz00'.
3 export default HarfBuzz00;
~~~~~~~~~~
node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:3:20
3 export default HarfBuzz00;
~~~~~~~~~~
'HarfBuzz00' was also declared here.
node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:8:20
8 export default HarfBuzz00;
~~~~~~~~~~
and here.
node_modules/@girs/gtk-4.0/node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:8:20 - error TS2300: Duplicate identifier 'HarfBuzz00'.
8 export default HarfBuzz00;
~~~~~~~~~~
node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:3:20
3 export default HarfBuzz00;
~~~~~~~~~~
'HarfBuzz00' was also declared here.
node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:8:20
8 export default HarfBuzz00;
~~~~~~~~~~
and here.
node_modules/@girs/gtk-4.0/node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-import.d.ts:5:9 - error TS2717: Subsequent property declarations must have the same type. Property 'HarfBuzz' must be of type 'typeof HarfBuzz', but here has type 'typeof HarfBuzz'.
5 HarfBuzz: typeof HarfBuzz00;
~~~~~~~~
node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-import.d.ts:5:9
5 HarfBuzz: typeof HarfBuzz00;
~~~~~~~~
'HarfBuzz' was also declared here.
node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:3:20 - error TS2300: Duplicate identifier 'HarfBuzz00'.
3 export default HarfBuzz00;
~~~~~~~~~~
node_modules/@girs/gtk-4.0/node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:3:20
3 export default HarfBuzz00;
~~~~~~~~~~
'HarfBuzz00' was also declared here.
node_modules/@girs/gtk-4.0/node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:8:20
8 export default HarfBuzz00;
~~~~~~~~~~
and here.
node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:8:20 - error TS2300: Duplicate identifier 'HarfBuzz00'.
8 export default HarfBuzz00;
~~~~~~~~~~
node_modules/@girs/gtk-4.0/node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:3:20
3 export default HarfBuzz00;
~~~~~~~~~~
'HarfBuzz00' was also declared here.
node_modules/@girs/gtk-4.0/node_modules/@girs/harfbuzz-0.0/harfbuzz-0.0-ambient.d.ts:8:20
8 export default HarfBuzz00;
~~~~~~~~~~
and here.