Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Given example is not working #44

Open
brunakov opened this issue Sep 25, 2021 · 1 comment
Open

Given example is not working #44

brunakov opened this issue Sep 25, 2021 · 1 comment

Comments

@brunakov
Copy link

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
Copy link
Author

widgetId is not present in URL was resolved by adding the widget to the room with :
/addwidget https://homeserver.com/#/?widgetId=$matrix_widget_id&userId=$matrix_user_id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant