microsoft / microsoft/azure-devops-extension-sdk

Error calling the IWorkItemFormNavigationService on an on-premise

Open
#23 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
159
Forks
53
PR merge metrics
No merged PRs in 30d

Description

Dear,
I am running into an error on an on-premise instance of Azure DevOps 2019. The same extension installed on an online organization, is working fine.

This the source code (typescript):
const navigationService = await SDK.getService<IWorkItemFormNavigationService>(WorkItemTrackingServiceIds.WorkItemFormNavigationService); if (typeof navigationService != 'undefined' && navigationService != null) { navigationService.openWorkItem(id, false); } else { throw new Error("Could not load WorkItemFormNavigationService from the SDK"); }

It is failing on the call to .getService() with the following message:
`
message: "No contribution provider or uri for ms.vss-work-web.work-item-form-navigation-service."

stack: "Error: No contribution provider or uri for ms.vss-work-web.work-item-form-navigation-service.
at t.getBackgroundHost (https://myserver.be/tfs/_static/_ext/ms.vss-web/ext-content/ms.vss-web.ext-content.luCfz4YwcHM3_pJR.min.js:1:19120)
at t.getService (https://myserver.be/tfs/_static/_ext/ms.vss-web/ext-content/ms.vss-web.ext-content.luCfz4YwcHM3_pJR.min.js:1:18834)
at https://myserver.be/tfs/_static/_ext/ms.vss-web/platform-content/ms.vss-web.platform-content.xjg1YXj9NZN2H2LQ.min.js:1:21067"
`

I have found a temporary workaround that works (but not as nice as it should)
const commonNavigationService = await SDK.getService<IHostNavigationService>(CommonServiceIds.HostNavigationService); if (typeof commonNavigationService != 'undefined' && commonNavigationService != null) { console.warn("Could not load WorkItemFormNavigationService from the SDK. Workaround applied.") commonNavigationService.navigate(editUrl); } else { throw new Error("Could not load HostNavigationService from the SDK"); }
Can someone please take a look?

Thanks in advance.

Kr.
Edward Trouw

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the TypeScript SDK.getService call for WorkItemFormNavigationService on Azure DevOps 2019 on-premise, then compare it with the working online organization and the HostNavigationService workaround shown here. Done means the work-item navigation service resolves correctly on-premise, or the supported limitation and expected alternative are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.