popescu alexandra
popescu alexandra

Reputation: 1

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getById')

I have the following error when I try to access my webpart that I have created: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getById').

The code is the following one:

public static async getChannels(groupId: string): Promise<any[]> {

    var channels: any[] = [];

    channels = await graph.teams.getById(groupId).channels.get();

    return channels;
  }

Thank you for your help!

Upvotes: 0

Views: 1220

Answers (0)

Related Questions