SharePoint / SharePoint/sp-dev-docs

Teams - Share app content to stage 501 error

Open
#10,239 13 comments 0 reactions 1 assignee View on GitHub

@Ashlesha-MSFT is already working on this.

Since May 8, 2025.

area:spfx-msteams sharepoint-developer-support type:bug-confirmed type:bug-suspected
Dominant language
PowerShell
Stars
1.4k
Forks
1.1k
Avg merge
4d 12h
Merged PRs (30d)
12

Description

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested
  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)
Additional environment details
  • SPFx version 1.21
  • Node.js version 18.18.0
Describe the bug / error

I'm working on an in-meeting app for Teams and cannot share app content to the stage. The default share to stage functionality works (i.e share button in bottom of side panel), but a custom share button that invokes context.sdks.microsoftTeams.teamsJs.meeting.shareAppContentToStage() results in the following error:

{ "errorCode": 501, "message": "API is not supported in current context-Provided URL is invalid" }

The URL I am passing in is the tenant URL. I am following this example.

My manifest file has the following domains listed: ["{teamSiteDomain}", "<<domain-name>>", "${{TAB_DOMAIN}}"]. I've tried various combinations of other domains as well, including just using ["*"]. The error doesn't appear to be coming from a network request, so I'm guessing there's an issue with how the validDomains property is being checked (or possibly with the domains I've listed).

I have the following permissions listed:

"permissions": {
      "resourceSpecific": [
        {
          "name": "LiveShareSession.ReadWrite.Chat",
          "type": "Delegated"
        },
        {
          "name": "LiveShareSession.ReadWrite.Group",
          "type": "Delegated"
        },
        {
          "name": "MeetingStage.Write.Chat",
          "type": "Delegated"
        },
        {
          "name": "OnlineMeeting.ReadBasic.Chat",
          "type": "Application"
        },
        {
          "name": "ChannelMeeting.ReadBasic.Group",
          "type": "Application"
        }
      ]
    }

and the following contexts:

"context": [
        "channelTab",
        "privateChatTab",
        "meetingSidePanel",
        "meetingDetailsTab",
        "meetingChatTab",
        "meetingStage"
      ]

I wasn't sure if this is an SPFx issue or a TeamsJS issue. I've opened a ticket there as well. Thank you!

Steps to reproduce
  1. Create an SPFx Teams in meeting app
  2. Enable custom share to stage in the manifest.json file "supportsCustomShareToStage": true
  3. Invoke `shareAppContentToStage(() => {}, {tenantUrl})
Expected behavior

In meeting app opens for each user in the stage context.

Contributor guide

Open the contributing guide

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.