microsoft / azure-devops-extension-sdk

Client SDK for developing Azure DevOps extensions
MIT License
122 stars 38 forks source link

SDK.getPageContext failed #81

Closed zagaria closed 8 months ago

zagaria commented 11 months ago

Hello team,

I tried to use getPageContext as outlined in the official documentation, but I encountered the following error:

Attempted to call getPageContext() before init() was complete. Wait for init to complete or place within a ready() callback

Even after adding

await SDK.init();
await SDK.ready();

before SDK.getPageContext(), I still received the same error.

Can anyone provide assistance with this issue?

Thanks.

zagaria commented 11 months ago

After a short debug, I found that the pageContext is located inside the context object. I have prepared a patch https://github.com/microsoft/azure-devops-extension-sdk/pull/82

cc: @lohitakshgupta, @nkirchem

zagaria commented 11 months ago

Hello.

@lohitakshgupta, @nkirchem did you have a chance to review?

lohitakshgupta commented 8 months ago

New version: 3.1.3 contains the fix for this issue. Thanks for letting us know about it.