sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

Incorrect placeholder interpretation in manifest.json for Teams tab app

Open Mhbuur opened this issue 7 years ago • 33 comments

Category

  • [ ] Question
  • [ ] Typo
  • [x] Bug
  • [ ] Additional article idea

Expected or Desired Behavior

Correct replacement of placeholders {teamSiteDomain}, {teamSitePath} etc. in manifest.json

Observed Behavior

When adding tab, the iframe src is not correct:

image

Steps to Reproduce

Follow this tutorial: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-web-part-as-ms-teams-tab

Mhbuur avatar Dec 04 '18 12:12 Mhbuur

Complete manifest.json:

{
  "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.2/MicrosoftTeams.schema.json",
  "manifestVersion": "1.2",
  "packageName": "HelloWorld",
  "id": "95d3f8c7-1a61-48b7-8e32-b990edd38695",
  "version": "0.1",
  "developer": {
    "name": "SPFx + Teams Dev",
    "websiteUrl": "https://products.office.com/en-us/sharepoint/collaboration",
    "privacyUrl": "https://privacy.microsoft.com/en-us/privacystatement",
    "termsOfUseUrl": "https://www.microsoft.com/en-us/servicesagreement"
  },
  "name": {
    "short": "HelloWorld"
  },
  "description": {
    "short": "HelloWorld description",
    "full": "HelloWorld description"
  },
  "icons": {
    "outline": "tab20x20.png",
    "color": "tab96x96.png"
  },
  "accentColor": "#004578",
  "configurableTabs": [
    {
      "configurationUrl": "https://{teamSiteDomain}{teamSitePath}/_layouts/15/TeamsLogon.aspx?SPFX=true&dest={teamSitePath}/_layouts/15/teamshostedapp.aspx%3FopenPropertyPane=true%26teams%26componentId=95d3f8c7-1a61-48b7-8e32-b990edd38695",
      "canUpdateConfiguration": false,
      "scopes": [
        "team"
      ]
    }
  ],
  "validDomains": [
    "*.login.microsoftonline.com",
    "*.sharepoint.com",
    "*.sharepoint-df.com",
    "spoppe-a.akamaihd.net",
    "spoprod-a.akamaihd.net",
    "resourceseng.blob.core.windows.net",
    "msft.spoppe.com"
  ],
  "webApplicationInfo": {
    "resource": "https://{teamSiteDomain}",
    "id": "00000003-0000-0ff1-ce00-000000000000"
  }
}

Mhbuur avatar Dec 04 '18 12:12 Mhbuur

Hey Michael, just want to make sure we are tracking down the same issue.

The problem is that when the iFrame loads, the {teamSiteDomain} and {teamSitePath} tokens are getting replaced with an empty string, rather than the actual domain and site, correct?

patmill avatar Dec 04 '18 17:12 patmill

Yep, that is what it seems like. I can add the app to Teams without any issues. The “about” dialog shows up, but when I add the tab to a channel, a dialog shows up with the broken iframe from which the screenshot is from.

Let me know If I can help any further 🙂

Mhbuur avatar Dec 04 '18 20:12 Mhbuur

I've forwarded this to the teams folks. They should hop on shortly.

patmill avatar Dec 04 '18 21:12 patmill

Interesting bug 🤔 Are you sure you're using the Public Developer Preview option in Teams?

lokimeyburg avatar Dec 04 '18 22:12 lokimeyburg

Yes, I enabled the dev preview as described here: https://docs.microsoft.com/en-us/microsoftteams/platform/resources/dev-preview/developer-preview

Mhbuur avatar Dec 05 '18 08:12 Mhbuur

I am seeing the same issue in some of my teams, but some do work. I did not have the time to analyze it any further, but I believe it is the case when I did not create the team via teams, but instead added a team to an existing group via graph api.

OliverZeiser avatar Dec 06 '18 07:12 OliverZeiser

Okay, that is interesting: I tried creating a new team in web client (developer preview mode) and add the helloworld app to that, and that actually worked.

I tried adding the app on the "old" team that failed earlier again (btw this was not created via Graph - just in the client a few months ago) and I still get the error here.

So it would seem like the SP hosted app feature is not working with "old" teams (whatever that means).

Mhbuur avatar Dec 06 '18 07:12 Mhbuur

@OliverZeiser, @Mhbuur, do the Files tabs in these teams work? If the teamSiteUrl property for you teams isn't configured then there should be other broken functionality there.

ydogandjiev avatar Dec 11 '18 18:12 ydogandjiev

Okay that is interesting. The Files tab did not work. It was saying something like "we are setting up your files...". (The site was created several days ago though) I then added the SharePoint Page App, which did work just fine. After going back to the files tab now this one is working as well. And in the end now my custom Teams SPFx App also works correct. So something musst have triggered and added the URL to the Team/Group. Probably because I was opening the File Tab or because I was adding the SharePoint Page App as a Tab. Maybe that gives you a hint to where the issue is coming from...

OliverZeiser avatar Dec 12 '18 11:12 OliverZeiser

For newly created teams the provisioning of the underlying SharePoint site can sometimes take up to 24 hours. I think we might need some kind of error handling + friendly error message for users that run into this. @lokimeyburg, this might be something we need to account for in our GA plans.

ydogandjiev avatar Dec 12 '18 18:12 ydogandjiev

@ydogandjiev This can not be the issue in my case. Because i have created the site/group first and then i added a Team to an existing Group. I am 100% sure that i was on the SharePoint site and it was fully working before I added a Team to it. So the underlying SharePoint site was provisioned!

OliverZeiser avatar Dec 13 '18 08:12 OliverZeiser

@OliverZeiser, it’s not necessarily the provisioning of the SharePoint site that’s holding things up. The linking of the team to the underlying SharePoint site is an async process that also takes time. I will ask some folks with more knowledge of this as to why that’s the case; however, this has been the design for some time now and there are likely good reasons for it to be so. In any case, please test your solution in teams where the Files tab is working in order to ensure that the necessary provisioning has completed.

ydogandjiev avatar Dec 13 '18 08:12 ydogandjiev

@ydogandjiev It is my older teams that have the problem - not the new ones I set up.

Mhbuur avatar Dec 21 '18 07:12 Mhbuur

Sorry for the delay on this. Is this still an issue within any tenant you have? Old or new? Obviously, we need to ensure that this is fixed by GA, so would love to get an updated status on this. Thanks for the updated information advance.

VesaJuvonen avatar Jan 15 '19 17:01 VesaJuvonen

@VesaJuvonen Yes I am still able to reproduce this issue. If I create a classic Teamsite, then groupify it and then add Teams functionality to the group. If i switch to MS teams and add an SPFx Teams App, i can then see that the placeholders are not getting replaced. This happens in the MS Teams client as well as Teams in the browser. If i switch to the files Tab in Teams, i see the message "We are setting up your file directory. Try refreshing the page after a few minutes or check back later." After some time the files tab works. Once that works, SPFx apps in teams also work just fine. If i create the team directly from within MS Teams, everything works right away. So the issue seems to be somehow related to groupify/teamify or simply to the fact that it is based on a classic teamsite.

OliverZeiser avatar Jan 16 '19 12:01 OliverZeiser

@VesaJuvonen Yes, it is still a problem in old teams - it is only working for newly created teams

Mhbuur avatar Jan 17 '19 08:01 Mhbuur

Thanks, everyone for following up on this. We are investigating to get this resolved by GA. We'll add more comments if there's anything new we can provide before 1.8.

VesaJuvonen avatar Jan 24 '19 18:01 VesaJuvonen

As a follow up. I got this error in a team created in April. Created a new team now, and there it works.

wobba avatar May 22 '19 16:05 wobba

I have the same problem with tokens not being replace if i install the spfx teams app to a team trough MS graph as described here: https://docs.microsoft.com/en-us/graph/api/teamsappinstallation-add?view=graph-rest-1.0

Using spfx 1.8.2.

Get the error message:

The web page at https://_layouts/15/TeamsLogon.aspx?SPFX=true&dest=/_layouts/15/teamshostedapp.aspx%3FopenPropertyPane=true%26teams%26componentId=3931098d-2a61-4bf7-88c7-1afc22fb0e5f%26forceLocale=en-gb might be temporarily down or it may have moved permanently to a new web address.

AndreasNorefalk avatar Jun 12 '19 13:06 AndreasNorefalk