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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK initialization failed, "No Parent window found" error #2347

Open
MajaEffenberg opened this issue Jun 4, 2024 · 12 comments
Open

SDK initialization failed, "No Parent window found" error #2347

MajaEffenberg opened this issue Jun 4, 2024 · 12 comments

Comments

@MajaEffenberg
Copy link

We are using version 2.20.0 of the teams-js libraryin our Angular application, which is displayed in Microsoft Teams Tabs.

During the initialization of SDK we start to see the following error reported in our app:
Initialization Failed. No Parent window found.

Our implementation of initialization:

import {app} from '@microsoft/teams-js';

await app.initialize();

Error appears for TeamsMobile-iOS on iPhones with different OS (16_6_1, 17_4_1, 17_5_1).
What can we do to avoid these errors as they appear randomly to different users? And why does this error appear at all?

Please let me know if you need any additional information.

@AE-MS
Copy link
Contributor

AE-MS commented Jun 4, 2024

Hi @MajaEffenberg. @KangxuanYe has been investigating reports like this and will reach out shortly to get more details.

@KangxuanYe
Copy link
Contributor

Hi @MajaEffenberg, we are working with this and still trying to find a way to debug in our testing environment with a demo app. So far we don't request any information from your side but that will be a potential step in the future for investigation.

We appreciate your patience and will keep working on this. Hopefully we could reach back to you within this week and if you didn't hear me back, please feel free to tag me for asking progress. Thank you.

@KangxuanYe
Copy link
Contributor

Hi @MajaEffenberg, could you please say more about this issue for us to investigate? Is this timeout happen when app is first loaded or it happens during authentication progress? Also, can this timeout issue be reproduced in your side? Thank you.

@MajaEffenberg
Copy link
Author

Hi @KangxuanYe This error happens when the app is first loaded during initialization, not during authentication. We were not able to reproduce this error on our side. We tested Microsoft Teams App (version 6.4.0) on iPhone with iOS 17.3.1 and all works well and no error appear. But in last week we received more of these errors, reported for different users.

@KangxuanYe
Copy link
Contributor

Hello @MajaEffenberg, if you cannot reproduce it, do you recall any steps you take for triggering the timeout issue? We will keep an eye on this issue and if next time you encounter this issue again, please come here and provide us steps and we can try to reproduce and investigate then.

Thanks for your report.

@sschoeb
Copy link

sschoeb commented Jun 17, 2024

@KangxuanYe I'm a coworker of @MajaEffenberg.

This is very hard to reproduce (we did not manage it yet :/). But we get reports from our monitoring that our users hit this bug. More or less every day someone seems to be struggling with it.

Here some additional info we logged when the error happened. The value of it after the //

window.parent === window // true
window.parent === self // true
window.parent === top // true
window.self === window.top // true
window.parent == undefined // false
navigator.language "de-DE"
window.origin  // https://profile.micromate.ai
window.webkit == undefined // true
window.messageHandlers == undefined // true
window.nativeInterface == undefined // true
window.name // ''

Could there be any other value that would be interesting for you?

We do not have direct access to the users (as these are users of our customers). But based on the URL it seems that the user has opened a tab within Teams.

What we know: If you open the tab directly within a browser, you will hit this error. So opening an app that initializes the teams-js library in a tab outside teams fails. Which is intended behaviour and makes sense. And as the agent ist "Netscape 5.0 (iPhone; CPU iPhone OS 17_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 TeamsMobile-iOS -?" This is not the case here.

@KangxuanYe
Copy link
Contributor

Hi @sschoeb, just to give you an update here that we are investigating this with logs you provided and we might need to reach another team for this issue since you are using Teams iOS. Thanks for your patience and we will share update here again once we find something or need something else from your side.

@sschoeb
Copy link

sschoeb commented Jun 21, 2024

@KangxuanYe thanks for your update. I'm happy to provide you with all the needed info, just let me know.

@KangxuanYe
Copy link
Contributor

Hi @sschoeb and @MajaEffenberg, sorry for waiting such a long time. We reached other teams and have discussions with them. They said that they acknowledged some similar issues that in old Teams iOS, there was an issue where nativeInterface object can get removed due to some cleanup bug. Thus, could you please specify what version of Teams iOS you are using? Thank you so much.

@MajaEffenberg
Copy link
Author

@KangxuanYe Currently, we only know that error appears on iPhones with different OS (16_6_1, 17_4_1, 17_5_1), but we do not have information about the client's Teams iOS versions.
How can we get this information directly in our application to log it along with the error? Is it possible to get that info from SDK?

@KangxuanYe
Copy link
Contributor

Hi @MajaEffenberg, thanks for letting us know. I don't think we have a solution to know iOS Teams version directly for now but we are thinking of something to be built so that we could know that in the future. Ideally we would like to know everything after client logging is enabled, but as you could try, you will not know iOS Teams version from our current logging. We have brought this topic to iOS Teams team and we are still figuring it out. Hopefully we could have some updates soon. We really appreciate you keep working with us. Thanks.

@sschoeb
Copy link

sschoeb commented Jul 4, 2024

@KangxuanYe thank you very much for your reply. As a side note, being able to ask teams-js about all the version details would be super helpful.

This as we face a lot(!) of bugs within teams and it would be much easier to have the understanding on which version the user is on.

So something like this would be great:

const version = app.host.versionInfo;

which then ends up in something like this:

{
    teamsAppVersion: 24165.1408.2960.3667
    clientVersion: 49/24053101421
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants