0

we are using teams sdk ("@microsoft/teams-js": "2.4.2") in our project to render our website as a personal app in Microsoft Teams.

Whenever our app loads, we initialise the library using --> app.initialize() and we set a local storage item after the app gets initialised. Like,

await app.initialize().then(()=>{ localStorage.setItem("inTeams", "true");

The SDK gets perfectly initialised when the app loads. But if we refresh multiple times continuously(like click on refresh button 20-30 times together) using the refresh icon present in top right corner of personal app, the sdk initialising is getting timed out and, we are not able to set the local storage item.

I think, the SDK should get initialised even if we click on refresh button so many times.

Error looked like:

    at Object.e.initialize (MicrosoftTeams.min.js:1274)
    at App.js:143
    at n (App.js:2)
    at Generator.<anonymous> (App.js:2)
    at Generator.next (App.js:2)
    at r (asyncToGenerator.js:3)
    at s (asyncToGenerator.js:25)
    at asyncToGenerator.js:32
    at new Promise (<anonymous>)
    at L.componentDidMount (asyncToGenerator.js:21)
    at fs (react-dom.production.min.js:4485)
    at react-dom.production.min.js:5478
    at t.unstable_runWithPriority (scheduler.production.min.js:235)
    at Di (react-dom.production.min.js:2345)
    at Au (react-dom.production.min.js:5304)
    at lu (react-dom.production.min.js:5019)
    at au (react-dom.production.min.js:4877)
    at Fu (react-dom.production.min.js:6052)
    at react-dom.production.min.js:6139
    at du (react-dom.production.min.js:5048)
    at Yu (react-dom.production.min.js:6138)
    at Object.t.render (react-dom.production.min.js:6294)
    at Module.58 (index.js:64)
    at s (VM15 Login:1)
    at Object.459 (styles.ts:292)
    at s (VM15 Login:1)
    at b (VM15 Login:1)
    at Array.e [as push] (VM15 Login:1)
    at main.9c435ace.chunk.js:1```
  • We have created personal tab application and added below code on Tab page. microsoftTeams.app.initialize().then(() => { localStorage.setItem("inTeams", "true"); }); We have clicked refresh tab icon 30 times but we are not getting initialization timeout error. – Nivedipa-MSFT Mar 27 '23 at 13:00
  • @Nivedipa-MSFT Thanks for your response. Will look at it, and will try to send a sample manifest. – Sanjana Gudla Mar 29 '23 at 12:02
  • @Nivedipa-MSFT I tried to replicate the same with a sample react app, but I couldn't replicate. I think, this error is coming up only if the website to be loaded is large. Could you look into it? – Sanjana Gudla Mar 31 '23 at 13:33
  • Could you please share the website which you are loading in personal tab to test at our end? – Nivedipa-MSFT Apr 05 '23 at 09:24
  • @Nivedipa-MSFT Sorry, it is our product website, we can't share the url as per our company policies but our react project parsed bundle size is 7.46 MB. Can this help? – Sanjana Gudla Apr 06 '23 at 08:23
  • bundle size cannot help here. – Nivedipa-MSFT May 04 '23 at 15:56
  • @Nivedipa-MSFT Can we provide anything else to help replicate this error? – Sanjana Gudla May 10 '23 at 08:43
  • Hello @SanjanaGudla - As we are not able to repro at our end and you are restricted to share your product site URL, could you please try updating your Teams JS library once and check it again? – ChetanSharma-msft May 25 '23 at 11:46

0 Answers0