webex / webex-js-sdk

JavaScript SDK for Webex
https://webex.github.io/webex-js-sdk/
Other
173 stars 344 forks source link

Webex SDK 3.3.1 | TypeError: Cannot read properties of undefined (reading 'internal') #3757

Open vishalyadaviit opened 3 months ago

vishalyadaviit commented 3 months ago

Webex SDK throwing | TypeError: Cannot read properties of undefined (reading 'internal')

Somehow the this loses the scope it has initially.

To Reproduce Node Version: v20.12.2 UI Framework: Vue: v3.4.29 Webex SDK: v3.3.1 Steps to reproduce the behavior:

  1. I made a very basic component, with just trying to register the meeting for webex cloud connection.
  2. You can take look at the sandbox (https://codesandbox.io/p/sandbox/webex3-sdk-poc-nmsytk)
export default {

data() {
    const myAccessToken =
      'YTA2MmEyZDItOTdmMS00MWRiLWE1NzQtMmRkYzIyMjQwNjNkMzhiZTgxNGUtNDE4_PF84_ba4155e8-7127-4fe1-b1a3-d8dfd3471500';
    return {
      webex: Webex.init({
        credentials: {
          access_token: myAccessToken,
        },
        logger: {
          level: 'debug',
        },
      }),
    };
  },
  async mounted() {
     try {
        await this.webex.meetings.register();
      } catch (error) {
        console.log('Mounted try catch error');
        console.log(error);
      }
  },

}
  1. See error

image

Application is breaking at this step in Webex SDK. image

Expected behavior It should successfully register the sdk. I'm passing a valid access_token.

Platform (please complete the following information):

vishalyadaviit commented 3 months ago

Also FYI: I don't think it has anything to do with the Vue framework, I tried with React. its the same issue. also I don't think there is any dependency of Node version either, tried on 16, 18.

sandiban commented 2 months ago

Hello @vishalyadaviit, Thanks for your patience so far! Could you kindly share us a sample Live Token once more so that we could check the scope it has. From the error, it looks to be something possibly with the scope it's about and also kindly confirm the Webex Account under which that Token belongs to.

Before directly trying on your code, you could check the same on Webex JS SDK latest sample here - https://webex.github.io/webex-js-sdk/samples/browser-plugin-meetings/ and just check if you're able to initialize it. If that works, you can follow the same credentials and dependency on your local setup.

hope that helps!

Regards! Sandip

vishalyadaviit commented 2 months ago

Hi @sandiban , Below is a valid meeting token for development purpose. YTA2MmEyZDItOTdmMS00MWRiLWE1NzQtMmRkYzIyMjQwNjNkMzhiZTgxNGUtNDE4_PF84_ba4155e8-7127-4fe1-b1a3-d8dfd347152f

I checked using the above sample site, it seems to be working fine on this site. I can see the meeting register is successful. image

however working with vuejs or reactjs it doesn't work.

"kindly confirm the Webex Account under which that Token belongs to." I don't have an id but it should be under humancaresystems company name.

sreenara commented 2 months ago

@vishalyadaviit thanks for reporting this issue. The error you're reporting is currently a warning. It shouldn't stop you from joining the meeting. Please look at the kitchen sink app here as you've observed correctly, that the error doesn't stop the meeting from going through. This is more of an issue on the way the component you've written is handling the initialization.

The failure of the meeting preferences is also not a problem. It is expected for users who don't have the right scopes in their access token to see this. This shouldn't stop the entire webex object from initializing.