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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悶SPFx v1.8.1 Regression with MSFT Teams Tabs? #3826

Closed
andrewconnell opened this issue Apr 23, 2019 · 3 comments

Comments

Projects
None yet
4 participants
@andrewconnell
Copy link
Collaborator

commented Apr 23, 2019

Category

  • Question
  • Typo
  • Bug
  • Additional article idea

Expected or Desired Behavior

I believe this is a bug... as I can't find a mention of this in the release notes for 1.8.1.

In SPFx v1.8.1, when you create new SPFx project, you should be able to access the MSFT Teams context via this.context.microsoftTeams.... This worked in v1.8.0, but in 1.8.1, the microsoftTeams property is not defined.

Digging deeper, the BaseClientSideWebPart WebPartContext object appears to have changed from v1.8.0 => v1.8.1:

/*聽Excluded聽from聽this聽release聽type:聽microsoftTeams聽*/

Whereas in SPFx 1.8.0 it was:

readonlymicrosoftTeams?:typeofteamsJs;

Observed Behavior

This code triggers a build error in an SPFx v1.8.1 web part project:

protected onInit(): Promise<void> {
  return new Promise<void>((resolve, reject) => {
    if (this.context.microsoftTeams) {
      this.context.microsoftTeams.getContext(context => {
        console.log('got teams context');
        resolve();
      });
    } else {
      resolve();
    }
  });
}

Steps to Reproduce

  • ensure install SPFx v1.8.1 is installed

  • create new SFPx web part

  • add the following code to the web part

    protected onInit(): Promise<void> {
      return new Promise<void>((resolve, reject) => {
        if (this.context.microsoftTeams) {
          this.context.microsoftTeams.getContext(context => {
            console.log('teams context', context);
            resolve();
          });
        } else {
          resolve();
        }
      });
    }
  • run gulp build & observe errors

  • repeat the same process above, but with SPFx v1.8.0 installed... observe it builds without error

@msft-github-bot

This comment has been minimized.

Copy link
Collaborator

commented Apr 23, 2019

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@patmill

This comment has been minimized.

Copy link
Contributor

commented Apr 23, 2019

So, bit of background. The public typings generation process went squirelly when we released 1.8.0, and it was fixed for 1.8.1. However, it looks like the microsoftTeams property didn't get moved from beta -> public, so when the typings cleanup process ran, it removed it from the public typings. For now, you can work around this by including the beta packages. We will fix this in the next drop. Thanks for the heads up.

@VesaJuvonen

This comment has been minimized.

Copy link
Contributor

commented May 7, 2019

Fixed with the 1.8.2 release, so closing this from here. Thanks for reporting this and sorry for the inconvenience caused by this regression.

@VesaJuvonen VesaJuvonen closed this May 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.