Skip to content

Uncaught TypeError: Unsupported type: function #53

@sigmaSd

Description

@sigmaSd
import { NamedArgument, python } from "https://deno.land/x/python@0.4.1/mod.ts";

const gi = python.import("gi");
gi.require_version("Gtk", "4.0");
const Gtk = python.import("gi.repository.Gtk");

function onActivate(app: any) {
  const win = Gtk.ApplicationWindow(new NamedArgument("application", app));
  win.present();
}

const app = Gtk.Application();
app.connect("activate", onActivate); // error here

app.run();
error: Uncaught TypeError: Unsupported type: function
        throw new TypeError(`Unsupported type: ${typeof v}`);
              ^
    at Function.from (https://deno.land/x/python@0.4.1/src/python.ts:533:15)
    at PyObject.call (https://deno.land/x/python@0.4.1/src/python.ts:760:57)
    at Proxy.object (https://deno.land/x/python@0.4.1/src/python.ts:258:20)
    at file:///home/mrcool/dev/deno/lab/a.ts:13:5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions