Skip to content

when opening dialog keeps getting error No handler found on any channel for message: #166

@wernerholzapfel

Description

@wernerholzapfel

I keep getting this error:
SDK.min.js:1 No handler found on any channel for message:

Documentation seems to be outdated ->
Not working: IHostDialogService doesn't exist.
https://github.com/MicrosoftDocs/azure-devops-docs/blob/main/docs/extend/develop/using-host-dialog.md

These are my contributions

{
            "id": "release-work-item-form-page",
            "type": "ms.vss-work-web.work-item-form-page",
            "description": "Release work item form page",
            "targets": [
                "ms.vss-work-web.work-item-form"
            ],
            "properties": {
                "name": "Release",
                "uri": "https://localhost:3000/workitem.html"
            }
        },
        {
            "id": "release-form",
            "type": "ms.vss-web.external-content",
            "description": "The content to be displayed in the dialog",
            "targets": [],
            "properties": {
                "uri": "https://localhost:3000/dialog.html"
            }
        },

In workitem I open the dialog:

async function openFullDialog() {
  const layoutSvc = await SDK.getService<IHostPageLayoutService>(CommonServiceIds.HostPageLayoutService);
  const extensionCtx = SDK.getExtensionContext();
  const contributionId = `${extensionCtx.publisherId}.${extensionCtx.extensionId}.release-form`;

  layoutSvc.openCustomDialog(contributionId, {
    title: "titel",
    onClose: result => {
      console.log("dialoog gesloten:", result)
    }
  });

}

and in dialog:

 useEffect(() => { 
const extensionCtx = SDK.getExtensionContext();
  
    const contributionId = `${extensionCtx.publisherId}.${extensionCtx.extensionId}.release-form`;

    SDK.register(contributionId, {});

    SDK.ready().then(() => {
    })

  }, []);

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