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

Error calling the IWorkItemFormNavigationService on an on-premise #23

Open
edtro opened this issue Mar 4, 2020 · 0 comments
Open

Error calling the IWorkItemFormNavigationService on an on-premise #23

edtro opened this issue Mar 4, 2020 · 0 comments

Comments

@edtro
Copy link

edtro commented Mar 4, 2020

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

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