You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
app.initialize() succeeds but getContext() never returns in Teams tab #80
app.initialize() completes successfully, but app.getContext() does not appear to resolve when the app is running as a Teams tab.
Is this the correct initialization pattern for the current Teams JS SDK? If not, what should I change, and are there any lifecycle or host-specific requirements I should be aware of?
SDK version: @microsoft/teams-js 2.x
Host: Microsoft Teams desktop
Thank you for reporting this issue. Here is an AI-generated initial response:
Classification: Upstream — the TeamsJS v2 call sequence is correct; if getContext() remains pending in a Teams tab, the cause appears to be outside the tab’s initialization code, but SDK-versus-host ownership is unverified.
The API contract requires app.initialize() to resolve before other SDK calls and says app.getContext() returns a promise for the current frame’s context.
A related report describes a pending getContext() after initialization, but in a message-extension authentication flow, not an ordinary tab. It is not an established duplicate.
What to do now:
Keep the existing await app.initialize(); await app.getContext() sequence; don’t switch to the v1 callback API.
Confirm the code runs in the tab’s content frame. Compare Teams desktop with Teams web, and log whether the promise rejects or stays pending.
Share the exact @microsoft/teams-js version, Teams desktop version, OS, manifest tab settings, and a minimal reproduction. No fixing TeamsJS version is established for this symptom.
Activity
atktroubleshootingapp commentedon Sep 29, 2026
👋 Hi @Ashlesha-MSFT,
Thank you for reporting this issue. Here is an AI-generated initial response:
Classification: Upstream — the TeamsJS v2 call sequence is correct; if
getContext()remains pending in a Teams tab, the cause appears to be outside the tab’s initialization code, but SDK-versus-host ownership is unverified.app.initialize()to resolve before other SDK calls and saysapp.getContext()returns a promise for the current frame’s context.getContext()after initialization, but in a message-extension authentication flow, not an ordinary tab. It is not an established duplicate.What to do now:
await app.initialize(); await app.getContext()sequence; don’t switch to the v1 callback API.@microsoft/teams-jsversion, Teams desktop version, OS, manifest tab settings, and a minimal reproduction. No fixing TeamsJS version is established for this symptom.Useful links:
appAPI contract