Skip to content

White screen on navigate with clear history parameter #829

Closed

Description

@NickIliev

From @mayureshjadhav on May 26, 2017 3:47

I am using NativeSctipt 2.5 and nativescript-angular 1.2.0 in my app.

Scenario is I am navigating from page 1 to page 2 while navigating I am clearing the history but I can see a white screen while moving from page 1 to page 2 .

What is the issue?

Copied from original issue: NativeScript/NativeScript#4269

Activity

  1. NickIliev commented on Jun 6, 2017

    @NickIliev
    Author

    @mayureshjadhav there might be multiple reasons for your issue so please post more detailed information on how to reproduce your case. As the latest version is 3.x.x we will need both the content of your package.json file and the code used to create your application - the best case would be to create a sample application that demonstrates the issue and what you have achieved so far.

  2. NickIliev commented on Jun 6, 2017

    @NickIliev
    Author

    From @mayureshjadhav on May 31, 2017 4:21

    Actually, I created project from hello word template and added two more pages and when I try to navigate from one page to another by using following code

    this.routerExtensions.navigate(["about"], {
                                clearHistory: true
                            });
    
    

    I can see a white screen and then it moves to about (another) page.

    Actually, you will not see the difference in a small application but when your app becomes complicated you will observe this issue.

  3. NickIliev commented on Jun 6, 2017

    @NickIliev
    Author

    @mayureshjadhav I was able to fully reproduce this issue using Angular application and ClearHistory set to true with some PageTransition (the default one as well). The issue is not reproducible with core NativeScript project. Marking this one as a bug - keep track of this issue for further updates.

    Reproducible with both iOS and Android but only in Angular based applications.

    Sample application to reproduce the issue can be found here.

    Steps to reproduce:

    • load the app
    • navigate with clearHistory set to true+ page transition (use some of the provided options in the app)

    Actual result: the current page is replaced with a white screen and then the navigation proceeds.

    Expected result : the current page to stay during the navigation transition as in this NativeScript core application

  4. added this to the milestone on Jun 13, 2017
  5. buuhuu commented on Jun 15, 2017

    @buuhuu
    Contributor

    A guess: This is caused because when clearHistory is set the Angular component tree gets destroyed in clearRefCache before the navigation begins causing views to be removed for the surface and resulting in a white page. Working on a PR to get that resolved.

    Update: My approach is, to instead of directly destroying the cached items I queue them into an array and destroy any queued items within the navigatedFrom event asynchronously. This also improves navigation performance as destroying the component tree (including freeing memory) seems to be a bit expensive

  6. added a commit that references this issue on Jul 12, 2017
    448412a
  7. removed this from the milestone on Aug 2, 2017
  8. jogboms commented on Sep 6, 2017

    @jogboms

    @sis0k0 @buuhuu sorry to drag this out again but using nativescript-angular (latest) and tns-core-modules (latest), This white screen still pops up after clearHistory.

  9. buuhuu commented on Sep 6, 2017

    @buuhuu
    Contributor

    Can you check if ngDestroy() is called before or after the navigation happened? Might be a regression with the latest changes and if so, it would probably make sense to open a new issue.

  10. vakrilov commented on Sep 6, 2017

    @vakrilov
    Contributor

    @jogboms I think this is a regression after the 4.2. There is a PR(#977) that might solve the issue again - can you check if it will work in your case.

  11. 4 remaining items

  12. jogboms commented on Sep 7, 2017

    @jogboms

    @vakrilov I'd make one up before the end of today and share it here.

  13. jogboms commented on Sep 7, 2017

    @jogboms

    @vakrilov created a sample app here

  14. jogboms commented on Sep 10, 2017

    @jogboms

    nativescript-angular@next

    Fixed #977.

  15. NickIliev commented on Sep 13, 2017

    @NickIliev
    Author

    +1 from t.1129772

    Navigating from one page to another causes the client application to flicker with a white screen.
    Note; The application is also using lazily loaded modules

  16. added this to the milestone on Oct 4, 2017
  17. vakrilov commented on Oct 10, 2017

    @vakrilov
    Contributor

    This one is already resolved using nativescript-angular@next with angular@4.4.
    Will be included in the official nativescript-angular@4.4.0 release.

  18. farfromrefug commented on May 17, 2019

    @farfromrefug

    @vakrilov sorry to bump that very old issue but i am seeing this in my app using 5.4.0 inside a Vue project. Could you explain (recall) what you changed in Angular to fix it?
    Might have to apply the same fix to Vue $navigateTo
    Thanks

  19. alexrainman commented on Oct 3, 2019

    @alexrainman

    This issue still there in current version :(

  20. farfromrefug commented on Oct 4, 2019

    @farfromrefug

    @alexrainman indeed still see this. But it is NOT related to angular!
    The original issue need to be unlocked / reopen
    And i think it might come from the iOS page implementation. I think it might come from some mix-up calls between viewWillAppear and viewDidAppear

  21. alexrainman commented on Oct 4, 2019

    @alexrainman

    @farfromrefug it is not just iOS, i happens in Android too.

  22. farfromrefug commented on Oct 4, 2019

    @farfromrefug

    @alexrainman ok then it might be an angular issue for you.
    Will open a new issue for my white screen :D

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions