skpm/dialog

`showMessageBox` segfaults

Opened this issue · 2 comments

chpio commented
import dialog from "@skpm/dialog";
import iconDefault from "./assets/icon.png";

// https://stackoverflow.com/a/58718960/5572146
export function impl<T>(struct: T): T {
    return struct;
}

    await dialog.showMessageBox(impl<dialog.MessageBoxOptions>({
        type: "info",
        title: `title`,
        message: `message`,
        icon: iconDefault,
    }));
  • sketch: v70.3
  • @skpm/dialog: v0.4.1
chpio commented

it seems to have something to do with the icon field.

after making the icon field optional (the readme says it should be optional, but it's not) and omitting it a dialog is shown.

what's the error? The icon is optional (https://github.com/skpm/dialog/blob/master/lib/message-box.js#L75-L91), it looks like a mistake in the types. Happy to accept a PR to fix it