matrix-widget-api icon indicating copy to clipboard operation
matrix-widget-api copied to clipboard

Given example is not working

Open brunakov opened this issue 3 years ago • 1 comments

The given example given in https://github.com/matrix-org/matrix-widget-api/tree/master/examples/widget, gives 404 for api.js. By replacing https://github.com/matrix-org/matrix-widget-api/blob/master/examples/widget/index.html#L50 with <script src="https://unpkg.com/[email protected]/dist/api.min.js"></script>, I get the following errors when opening the Custom Widget:

 Action:notify_capabilities failed with message: The postMessage was unhandled generic-f65725513b138597c58f.bundle.js:77:8220
    value https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:77
    value https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:77
    value https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:77
    (Async: EventListener.handleEvent)
    value https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:77
    t https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:77
    value https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:79
    Tr https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:61
    oi https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:61
    unstable_runWithPriority https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:77
    Wt https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:61
    ii https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:61
    Wr https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:61
    zr https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:61
    Pi https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:61
    Di https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:61
    Qr https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:61
    Di https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:61
    render https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:69
    <anonymous> https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:79
    t https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:1
    <anonymous> https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:1
    <anonymous> https://scalar.vector.im/api/widgets/generic-f65725513b138597c58f.bundle.js:1

and

 Error: widgetId is not present in URL - cannot load widget
    assertParam https://my.homeserver.com/matrix-widget-api/examples/widget/utils.js:24
    <anonymous> https://my.homeserver.com/matrix-widget-api/examples/widget/index.html:59
utils.js:29:13
    handleError https://my.homeserver.com/matrix-widget-api/examples/widget/utils.js:29
    <anonymous> https://my.homeserver.com/matrix-widget-api/examples/widget/index.html:102

Would be great to have a working boilerplate to experiment with.

brunakov avatar Sep 25 '21 12:09 brunakov